Skip to content
← Back to Community
πŸ’₯🌾🌾FARMING GAME 🍠🍠 WITH LIVE LEADER BOARDπŸ†πŸ’₯
Profile icon
PYer

A game inspired with the help of @Atari7! With a live leaderboard, you can compete with friends and compare your skills to other players! Complex strategy, never-ending fun, will keep you busy at night. A farming extravaganza, with strategy, thinking, farming, and a bit of luck, have fun!

PS: Those of you who have seen this before, it now works for anybody!

Voters
Profile icon
FRANCESCOTMONEZ
Profile icon
parkerslv
Profile icon
Myzta
Profile icon
CoolJames1610
Profile icon
Acer123
Profile icon
YSF365
Profile icon
SeseiFlexFlex
Profile icon
SamuelAuterson
Profile icon
Mustafa12324
Profile icon
CaleeMills
Comments
hotnewtop
Profile icon
AQDProjects

Looks Like you have an error:

Traceback (most recent call last):
File "main.py", line 21, in
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers
ξΊ§

Profile icon
Haaruun

@AQDProjects yea someone posted a score of "inf" and it broke the avrage function

I have a fixed version @ https://Farming-Game-verifier.haaruun.repl.run
pyelias made a game verifier

Profile icon
AQDProjects

@Haaruun Should've read further into the comments, looks like I was late to the party

Profile icon
pyelias

I made a bot to automate it
https://repl.it/@pyelias/Farming-Game-bot

Profile icon
PYer

@pyelias wow thats amazing. it gets the highest score iv ever seen

Profile icon
bossotron13

Looks awesome, i hope you don't mind me having a try at Creating a game like this. I have 0 ideas and when i see people making games i always think β€œi should have though of that”.

Profile icon
PYer

@bossotron13 that's fine! maybe I could post a tutorial on a game like this if you want it

Profile icon
bossotron13

@PYer That would help me and others if you find the time.

Profile icon
PYer

@bossotron13 ok ill start writing one!

Profile icon
RileyGrooms1

I have created a Endless Mode of this game
https://repl.it/@RileyGrooms1/Farming-Game-Endless-Mode

Profile icon
PYer
Profile icon
PYer

I made one that displays the score after every turn! (Instead of the days left.) @RileyGrooms1

Profile icon
RilGames

oh thats cool @PYer

Profile icon
PYer

thanks. you can add it to yours. @RilGames

Profile icon
DJWang
Profile icon
PYer
Profile icon
HILLIARDGALLOW1

Traceback (most recent call last):
File "main.py", line 21, in
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers

Profile icon
PYer

it works now. thank you @HILLIARDGALLOW1

Profile icon
C00lguy975
Profile icon
Haaruun

@C00lguy975 yea someone posted a score of "inf" and it broke the avrage function

I have a fixed version @ https://Farming-Game-verifier.haaruun.repl.run
pyelias made a game verifier

Profile icon
[deleted]

accidentally crashed the game DB while trying to cheat in it

Profile icon
Haaruun

@sanjaykdragon saw that, you posted "inf" wich is not a number, try and cheat this one tho @ https://Farming-Game-verifier.haaruun.repl.run

Profile icon
[deleted]

@Haaruun can't cheat by POST'ing in that version because it actually simulates my entire moveset

Profile icon
Haaruun

something is wrong w/ your database specifically the avg function im assumuing its because a user haxor overflowed the average function but i cant test it beacuse in dont have the mongo password

Profile icon
PYer

there is something wrong with the average function. it is easy for people to add their own data into the database though, im trying to work on a way to fix that. @Haaruun its really hard to add security with a leaderboard like that.

Profile icon
pyelias

@PYer The average function on the server-side is fine, but only taking the first 8 characters in getavg makes it work wrong for large numbers. You should use round or something like this instead. And for security, you could record the users actions and simulate them on the server to make sure the score is legitimate.

Profile icon
Haaruun

@pyelias you would have to do everything on the server move by move because whats stopping someone from faking there actions by changing the benefits that happens while playing. if replit supports it i would recommend websockets to stop the delay from opening a connection and posting each time

Profile icon
pyelias

@Haaruun You can send the random state to the server as well to have it check that the benefits were generated normally.

(something like this and this. Feel free to just copy parts of that, there's no point rewriting it)

Profile icon
Haaruun

@PYer i got a working leaderboard server w/ game verification but im using a free mongodb and bots score so high it wont store it

https://Farming-Game-Server-2--haaruun.repl.co

Profile icon
Haaruun

with all the bots coming on im going to try to make a seprate bot server w/ bot contests (saving bot 3.0 till then :P )

Profile icon
PYer

oh yeah I saw. that sounds cool! @Haaruun

Profile icon
PYer

HELLO EVERYONE! I noticed a lot of people have been commenting on an error. I fixed it and it should work. @Haaruun Described the error if you want more information.

Profile icon
TheBlacksmith

It says
Traceback (most recent call last):
File "main.py", line 21, in
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers

Profile icon
Haaruun

@TheBlacksmith yea someone posted a score of "inf" and it broke the avrage function

I have a fixed version @ https://Farming-Game-verifier.haaruun.repl.run
pyelias made a game verifier

Profile icon
juanalbglz

interrupted by 13/365 days :/
THE FARMING GAME ||
By PYer ||

Days Left [ 13 ]
Crops [ 8 ]
Seeds [ 107808038 ]
Total Land [ 423950450 ] feet
Unused Land [ 0 ] feet
Workers [ 49486704 ]
Harvested [ 82477840 ] crops!

Nothing extraordinary happened today.

Profile icon
PYer
Profile icon
Haaruun

3rd place Yay

Profile icon
PYer

@Haaruun good job!

Profile icon
DJWang
Profile icon
SaptarshiHalder

@DJWang πŸ‘πŸ‘πŸ‘

Profile icon
PYer

@SaptarshiHalder what is it with those emojies?

Profile icon
PYer

@DJWang Nice!

Profile icon
[deleted]

Traceback (most recent call last):
File "main.py", line 22, in
nscores.append((player['s'], player['n'].rstrip()))
TypeError: string indices must be integers
ξΊ§
please fix

Profile icon
ripu

How do you do it so that you can just press any key without having to press ' enter' and it will continue?

Profile icon
PYer

I created a function using the module readchar. Here it is:

def newinput(prompt): stdout.write(prompt) stdout.flush() return str(readkey())

@ripu

Profile icon
ripu

ok thanks!
@PYer

Profile icon
PYer

no problem @ripu

Profile icon
[deleted]

How to do live leaderboard

Profile icon
KellerWorthen

I like this game! Can I embed it in my website?

Profile icon
PYer

sure, just please give me a simple credit and link to my profile please. juse Created by @PYer works. Thanks! @KellerWorthen

Profile icon
KellerWorthen

@PYer here's the website: https://replgames.kellerworthen.repl.co/
it is a collection of good games created on repl.

Profile icon
PYer

@KellerWorthen cool thanks!

Profile icon
LoneAce

Just asking out of curiosity, does using Flask and hiding the database inside a .env make the data more secure? I would like to implement this into my own projects if it means that people are not able to change the server data to whatever they want. Thanks

Profile icon
PYer

not really. it prevent people from deleting scores as well as manually changing the average and scores/ usernames. Basically, it prevents them from having complete control, but they can still add any scores they want by visiting the site. The main reason was to make it harder to change, but people found out still. @LoneAce

Profile icon
LoneAce

@PYer Yea I expected that. However, if the Flask server was to return a piece of data from a .env file does it mean that another person can just make another repl and use the same app.route to get the data?

Profile icon
PYer

they could open up the flask app without opening your repl. then they oculd see any of the returned data. @LoneAce

Profile icon
LoneAce

@PYer Right. But what if the repl is a private one made using a Hacker plan? Will the data be more secure? If it is I will consider subscribing

Profile icon
PYer

i don't think so. Anybody could still view the flask server. just not the code. @LoneAce

Profile icon
LoneAce

@PYer Okay thanks mate

Profile icon
PYer

no problem. you could ask @pyelias he developed a secure way to create data, that includes a flask server. It's somewhere in these comments. @LoneAce

Profile icon
b30wulf

super fun! i really enjoyed this (:

Profile icon
PYer

thanks! @b30wulf

Profile icon
JosMag2019

my game dosent work

Profile icon
PYer

why not! @JosMag2019

Profile icon
JosMag2019

there is a error @PYer

Profile icon
PYer
Profile icon
Mustafa12324

awesome, i like it very much

Profile icon
PYer
Profile icon
banew

i made a score of 131432.0 points. really cool game!
also, the score website is not working (404)

Profile icon
PYer

nice job! @banew

Profile icon
Gu_Yamauchi

ta kebrado

Profile icon
Trapdoorspyder

I'm getting a error on line 22

Profile icon
PYer
Profile icon
Kamlemyar

That was a really fun game

Profile icon
PYer
Profile icon
JosMag2019

the best

Profile icon
PYer
Profile icon
Banger

not bad with imagination

Profile icon
PYer

thanks @Banger

Profile icon
gcard03

Wym?

Profile icon
PYer

what do you mean? @gcard03

Profile icon
gcard03

Im talking about [email protected]