I like the animation
I like the animation
A language where you can create your own loops
like
loop repeatUntil {
if condition {
stop
}else {
run
}
}
The condition keyword is the condition that is put into the loop, the stop keyword tells the loop to break, and the run keyword runs the code you put in your loop. Also the loop keyword is for defining loops and after that in this example, repeatuntil, is the name of your loop.
This is cool you should make a UI though
There is an error when I press enter by itself and the game crashes
This is not a game maker.
This is what I'd recommend:
userInput = none
def testInput(input) -> bool:
try:
int(input)
except:
return False
else:
if int(input) < 0 or >= datetime.datetime.today().year:
return False
else:
return True
firstTime = True
while not(testInput(userInput):
if firstTime = False:
print("Invalid Year")
userInput = input("What year were you born: ")
It asks you to input the year again is it cannot be converted to a string or the value is negative
Wow that's really cool. I know I could never do that XD
You could use pygame. I made this really helpful template that makes using pygame a breeze.
https://repl.it/talk/templates/Python-Game-Template/54766
It's kind of laggy. Try to stop the printing in the console, I think that will help
I made a tic tac toe game with pygame
@DungeonMaster00 Ha that would use up your repl storage so fast
Another cool idea. I'm calling it simplified condition statements.
To use this you have to write a term and an optional bool operator in front of the if then statement:
myVar == if
Say you are going to use that term and operator a lot in an if then statement you could just do this
myVar == if var2 && var3 && var4
This translates to
if myVar == var2 && myVar == var3 && myVar == var4
It much easier to do it the first way. Also you can remove the operator and just do something like this
myVar if == var2 and <= var3 or >= var4
You can also override the operator
myVar == if var2 and <= var3 and var4
Also to exclude variables from this put the conditions in a loop like this ex():
myVar == if var2 and var3 and ex(var4 and var5)
Didn't you make night?
This is pretty cool
Cool
@ZDev1 So you can put multiple lines of code on one line
I get this
Traceback (most recent call last):
File "main.py", line 427, in <module>
main();
File "main.py", line 268, in main
inv.get_items(inventory);
File "/home/runner/50wo44tdsbw/inv.py", line 23, in get_items
db_inv = replit.db["inventory"];
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/replit/database/database.py", line 169, in getitem
raise KeyError(key)
KeyError: 'inventory'
Wow that was awesome
@elipie I don’t know what you mean
So it's just completely random?
This is cool
The controls don't seem to work.
If you have any questions about python I can answer them
@studentAlfredAl You will when Trump gets elected
@studentAlfredAl No one mentions the flu anymore because they don’t want people to find out it’s worse than Covid
@studentAlfredAl Well your information is wrong
@studentAlfredAl You need to get your information someplace other than social media and CNN
This is cool