Skip to content
← Back to Community
Dog/Health Game
Profile icon
PYer

I had a competition with another coder @sojs to who could create a game quickest. You had to simulate a dog, that would lose health multiple times as a loop iterates. The game would have to make the user feed it to increase the health of the dog, whereas the dog would lose health. If the dog's health fell under 50, you would earn food, that you could then feed the dog with. But, if the dog's health falls under 50%, there is a 1/4 chance that the dog will die. The point is to keep it alive as long as possible. I was bored so I also created a bot for the game, which I heard got a score of 183. My personal high score is 76 (now).
- Keep coding and stay safe!
PS: Comment your highscores if you want to!

Voters
Profile icon
CoolJames1610
Profile icon
CodingGoose
Profile icon
Pythonier
Profile icon
Acer123
Profile icon
Atari7
Profile icon
Awsute
Profile icon
Jakman
Profile icon
CodingCactus
Profile icon
SilentShadowBla
Profile icon
BorblyGerg
Comments
hotnewtop
Profile icon
BraylanBB121

I played 'player' and it gave me an error, name 'f1' not defined?

Profile icon
PYer

Thanks, @BraylanBB121! I must have added an f while typing, it's supposed to be 1. Thanks!

Profile icon
BraylanBB121

@PYer No problem!

Profile icon
BraylanBB121

My bot did 1000 games and got a high score of 158.

Profile icon
PYer
Profile icon
YeetMstr

botted 99 times
Average score 16.545454545454547
Oof

Profile icon
CodingCactus

I botted it 9999 times and got 169
Also, for the botting, it would be better if you could see how many tries are left see here

Profile icon
PYer

I'll add that! Thanks for the suggestion. @CodingCactus

Profile icon
PYer

Your linked repl doesn't seem to show the remaining amount of iterations. But I can add it either way, it's not that hard :) @CodingCactus

Profile icon
CodingCactus

@PYer it should (above health and stuff):

image

Profile icon
PYer

Oh yeah I see. I just added it. It lags a lot though. @CodingCactus

Profile icon
CodingCactus

@PYer ok, thanks :)

Profile icon
BlueComet

I got 48 on my first

Screenshot 2020-04-13 at 1.01.48 PM

Profile icon
PYer

wow, do you have any specific strategy? @iterate

Profile icon
BlueComet

@PYer just spam f and continue until you die and this is pretty cool

Profile icon
imacceol

Kind of simple but cool. I'll challenge one of my friends to creating a game like this as well. Take an upvote.

Profile icon
PYer

thanks! @imacceol

Profile icon
JACKYLIANG7

I ran the program for 20,000 times and got 187 as high score

Profile icon
DylanMaxwell

I got a high of 183 botted!
Lets see if i can make it higher!

Profile icon
PYer
Profile icon
[deleted]

Good!

Profile icon
PYer

Thanks! Glad you liked it! @Zuhdi28

Profile icon
JackLIM1

My bot got 143 and I played it 1000 times lol

Profile icon
PYer

Nice! That's higher than I've every seen! @JackLIM1

Profile icon
Jakman

i like the use of those f'strings'. very good taste.

Profile icon
PYer

thanks @Jakman

Profile icon
Codemonkey51

Cool! I got 17

Profile icon
PYer

dang it, My highest is 15. I'll have to play again. @Codemonkey51

Profile icon
Codemonkey51

Lol I beat the creator! @PYer

Profile icon
sojs
Profile icon
PYer

do you have any strategy? @Codemonkey51

Profile icon
PYer

ha, I just got 20. @Codemonkey51

Profile icon
Codemonkey51

Umm go down heal some but not wasting any by going over, repeat @PYer

Profile icon
PYer

mine is just to feed whenever possible. that's the same one the bot does. @Codemonkey51

Profile icon
Codemonkey51

Arggg @PYer

Profile icon
Codemonkey51

Oh ok @PYer

Profile icon
PYer

HA! I just got 61! @Codemonkey51

Profile icon
Codemonkey51

Dang @PYer

Profile icon
Codemonkey51

BOT GOT 80 BEAT THAT @PYer

Profile icon
PYer

hmmmmmm... I'll try lol @Codemonkey51

Profile icon
Codemonkey51
Profile icon
PYer

I got close to beating 80, at 76. I was so excited, but then I died. :( @Codemonkey51

Profile icon
Codemonkey51