Share your repls and programming experiences

← Back to all posts
Dog/Health Game
PYer (3460)

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!

Commentshotnewtop
BraylanBB121 (80)

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

PYer (3460)

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

BraylanBB121 (80)

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

CodingCactus (3033)

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

PYer (3460)

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

PYer (3460)

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

CodingCactus (3033)

@PYer it should (above health and stuff):

PYer (3460)

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

BlueComet (116)

I got 48 on my first

PYer (3460)

wow, do you have any specific strategy? @iterate

BlueComet (116)

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

imacceol (3)

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

epicman702 (216)

botted 99 times
Average score 16.545454545454547
Oof

DylanMaxwell (1)

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

[deleted]

Good!

PYer (3460)

Thanks! Glad you liked it! @Zuhdi28

JackLIM1 (1)

My bot got 143 and I played it 1000 times lol

PYer (3460)

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

Jakman (455)

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

PYer (3460)

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

Codemonkey51 (869)

Lol I beat the creator! @PYer

PYer (3460)

do you have any strategy? @Codemonkey51

Codemonkey51 (869)

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

PYer (3460)

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

PYer (3460)

hmmmmmm... I'll try lol @Codemonkey51

PYer (3460)

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