Three Ways
Equation (184)

Hello !
This is my three ways game. You can move the ball with k, l, and m or arrows. Press enter to play and retry. It's better to play in a new tab. I hope you will enjoy it.
I'm still working on it, so it's not finished. I will add a system to change the size of the game on the screen, change the menu screen, and add a config to move with the arrows. You can tell me if you find bugs or things to improve.
If the screen is oversized, you can go to this link :
https://three-ways--equation.repl.co/
You enjoyed the game ? Don't forget to upvote !
Now available : gold rush ! Go on the paddle to earn gold !
Have fun !
(Sorry for my bad English, this game comes from France ;)

You are viewing a single comment. View All
SakuraKimiko (4)

Hello, I did not get a chance to play your game but I'll try it later. Could you help me with my code.
I am a complete beginner (a baby in programming or python world)
my code is as follows

import random
random.randint(20,100)
age=int(input("What is your age:"))
agegap=int(random.randint(20,100))
print (agegap)
while True:
if age>agegap:
print("You are older")

elif age==agegap:
print ("You are of the same age")

else:
print("You are younger")
after it prints you are younger, same age or older I want it to ask the question again. How would I do that? I 've tried adding while true: but loops the answer in an infinite loop. I want it to give the answer once and ask the question again.

Could you help me with it

thank you

Sakura

Equation (184)

@SakuraKimiko hello !
You can add a system of parts in your code, like that :

import random
random.randint(20,100)
agegap=int(random.randint(20,100))
print (agegap)
myBolleanValue == True

step = 1

while myBolleanValue == True:
if step == 1 :
age=int(input("What is your age:"))
if age>agegap:
print("You are older")
step ++

              elif age==agegap:
                          print ("You are of the same age")
                           step ++

               else:
                        print("You are younger")
                        step ++
     elif step == 2 :
            age=int(input("What is your age:"))
             //

First, add a boolean variable as condition to your loop. Like that, if you want to stop it, you just have to write myBooleanValue = False in your code.
Second, a step system will ask the question to the user, analyse the answer (older or younger) and go to step 2. In step 2, you write that the variable value is "age" equal to the user answer, so it will ask the user a second time.

I hope it will be useful. If you have more question, you can ask me.

(don't forget to vote ;)

JohnnyWobble (50)

@SakuraKimiko what is wrong with this?

import random
random.randint(20,100)
agegap=int(random.randint(20,100))
print (agegap)
while True:
  age=int(input("What is your age:"))
  while True:
    if age>agegap:
      print("You are older")
      break
    elif age==agegap:
      print ("You are of the same age")
      break
    else:
      print("You are younger")
      break
CalsonLee (8)

@JohnnyWobble The nested while loop is unnecessary. You could use try/except to try doing int(input("What is your age:")). Then, if the user enters something like "end", there will be an error which will trigger the except. In the except, put break. If you're confused, try looking through the documentation.

SakuraKimiko (4)

@CalsonLee Thank you for your help, do you have any websites you can recommend, I am currently learning from udemy

SakuraKimiko (4)

@Equation Hello sorry for the late reply but thank you so much for your help in this equation, is this all python or are we adding some other coding language,
I really want to become good in python because I want to do something in data analysis and I think it uses either r or python.
I could really use you help just like this. Thank you

Equation (184)

@SakuraKimiko No problem ! To learn more about programming in python or in other langage, there are many lessons on YouTube, and I know a site, https://openclassrooms.com : it's a very good site to learn coding, and it's free. I learn JavaScript here. Thanks for playing, and if you have more question, you can ask me :)

SakuraKimiko (4)

@Equation Hello again I need your help with this code

memberlist=[]
print ("**Welcome to mymailbox.com *")

asking whether they would like to sign up or already a user

alreadymember=input("Are you a member?:").lower()

while True:
if alreadymember=="Yes" or alreadymember=="YES" or alreadymember=="yes" or alreadymember=="y" or alreadymember=="Y":
print("Welcome, Please login")

elif alreadymember=="No" or alreadymember=="NO" or alreadymember=="no" or alreadymember=="n" or alreadymember=="N":
signup=input("Would you like to signup?:").lower().upper()

member=input("Enter your user name:").strip().title()

if member in memberlist:
print("Welcome", (member))

else:
print ("member not found")

signup=input("Would you like to signup?:").lower().upper()

if signup=="yes"or signup=="YES" or signup=="yes" or signup=="y" or signup=="Y":
print("Kindly fill out the following form")

First_name=input("Enter Your first name:")
Second_name=input("Enter Your last name:")
Age=int(input("Enter Your age:"))
Occupation=("What is your occupation:")
Username=input("Enter your username:")
memberlist.append(First_name)
print("Welcome to the Team",(First_name))

elif signup=="No"or signup=="NO" or signup=="no" or signup=="N" or signup=="n":

print("Enjoy browsing mymailbox.com, Hope you change your mind and join our team")

print(memberlist)

there are a few problems with it they are as follows

when I say I don't want to signup it shows "enter your username" where as I want it to say "Enjoy browsing mymailbox.com, Hope you change your mind and join our team" (as I have mentioned at the end of the print)

It doesn't add the name in the list. I have given the command to print the name once added in the list, but when I enter the name again (in the same process) it says member not found. e.g. if i say i want to sign up and fill the form with the name nancy etc it shows the name nancy and it asks again enter your user name when I enter the name nancy again it says member not found.

I will appreciate your help, I have been wracking my brains on it for about a week now

Thank you in advance :)

Equation (184)

@SakuraKimiko Could you send me your repl's link, so that I could look it more precisly ?

SakuraKimiko (4)

@Equation ..

https://repl.it/@SakuraKimiko/dictionaries

if this doesnt work I am copying the code once more

memberlist=[]
print ("**Welcome to mymailbox.com *")

asking whether they would like to sign up or already a user

alreadymember=input("Are you a member?:").lower()

while True:
if alreadymember=="Yes" or alreadymember=="YES" or alreadymember=="yes" or alreadymember=="y" or alreadymember=="Y":
print("Welcome, Please login")

elif alreadymember=="No" or alreadymember=="NO" or alreadymember=="no" or alreadymember=="n" or alreadymember=="N":
signup=input("Would you like to signup?:").lower().upper()

member=input("Enter your user name:").strip().title()

if member in memberlist:
print("Welcome", (member))

else:
print ("member not found")

signup=input("Would you like to signup?:").lower().upper()

if signup=="yes"or signup=="YES" or signup=="yes" or signup=="y" or signup=="Y":
print("Kindly fill out the following form")

First_name=input("Enter Your first name:")
Second_name=input("Enter Your last name:")
Age=int(input("Enter Your age:"))
Occupation=("What is your occupation:")
Username=input("Enter your username:")
memberlist.append(First_name)
print("Welcome to the Team",(First_name))

elif signup=="No"or signup=="NO" or signup=="no" or signup=="N" or signup=="n":

print("Enjoy browsing mymailbox.com, Hope you change your mind and join our team")

print(memberlist)

I had added the print(memberlist) at the end because I wanted to see whether it is accepting the name or not, when you run it again in the same process, you'll notice it will show the name e.g nancy but when you'll enter the name nancy again it 'll say member not found.
Secondly if we say we don't want to signup it should say
Enjoy browsing mymailbox.com, Hope you change your mind and join our team
rather it says enter user name
Thank you again for your time :>