Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

brownie function! #32

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

brownie function! #32

wants to merge 6 commits into from

Conversation

sh-angl
Copy link

@sh-angl sh-angl commented Mar 3, 2020

its jsut a command where people can view how many brownie points they have gotten and also be able to give brownie points
the code is very bad
ver bad
i insist
very bad
also the only restriction i have is that you cant give yourself a brownie point

if (System.getenv(variable) == null) {
println("$variable not set\nExiting")
exitProcess(1)
}
}
var fileObject = File("brownieLeaderboard.txt")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text_file.exe OwO

if (System.getenv(variable) == null) {
println("$variable not set\nExiting")
exitProcess(1)
}
}
var fileObject = File("brownieLeaderboard.txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a dB instead of a file, simply a pair of user ID to amount of brownie points should be fine

// gonna use a file cause i dont know if im allowed to use a databse
var leaderboardFile = File("brownieLeaderboard.txt")
var yes = leaderboardFile.readLines()
if (receiver != null && author.id != receiver.id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a check to see that the author has not given someone else a brownie already today, could get quite spammy as it is now. This could be checked by simply storing author ID to the timestamp of the last time they gave a brownie point.


// gonna use a file cause i dont know if im allowed to use a databse
var leaderboardFile = File("brownieLeaderboard.txt")
var yes = leaderboardFile.readLines()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better variable names PLEASE

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants