##### Three Ways
Profile icon
Equation

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
Profile icon
SakuraKimiko

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)
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

Profile icon
Equation

@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 :
if age>agegap:
print("You are older")
step ++

```.css-19sk4h4{position:relative;}.css-1bu6gr6{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;position:relative;}.css-1n2m10r{padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1hwur6u{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1svvr0w{height:0;}.css-rk73ff{padding:var(--space-4);padding-left:var(--space-4);padding-right:var(--space-2);font-family:var(--font-family-code);font-size:14px;line-height:var(--line-height-small);overflow-x:auto;tab-size:2;word-break:break-word;white-space:break-spaces;overflow-wrap:anywhere;}```              elif age==agegap:
print ("You are of the same age")
step ++

else:
print("You are younger")
step ++
elif step == 2 :
//``````

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 ;)

Profile icon
JohnnyWobble

@SakuraKimiko
what is wrong with this?

```.css-19sk4h4{position:relative;}.css-1bu6gr6{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;position:relative;}.css-1n2m10r{padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1hwur6u{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1svvr0w{height:0;}.css-rk73ff{padding:var(--space-4);padding-left:var(--space-4);padding-right:var(--space-2);font-family:var(--font-family-code);font-size:14px;line-height:var(--line-height-small);overflow-x:auto;tab-size:2;word-break:break-word;white-space:break-spaces;overflow-wrap:anywhere;}```import random
random.randint(20,100)
agegap=int(random.randint(20,100))
print (agegap)
while True:
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``````
Profile icon
CalsonLee

@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.

Profile icon
SakuraKimiko

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

Profile icon
SakuraKimiko

@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

Profile icon
Equation

@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 :)

Profile icon
SakuraKimiko

@Equation
Hello again I need your help with this code

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

while True:

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

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

else:

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")

```.css-19sk4h4{position:relative;}.css-1bu6gr6{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;position:relative;}.css-1n2m10r{padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1hwur6u{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1svvr0w{height:0;}.css-rk73ff{padding:var(--space-4);padding-left:var(--space-4);padding-right:var(--space-2);font-family:var(--font-family-code);font-size:14px;line-height:var(--line-height-small);overflow-x:auto;tab-size:2;word-break:break-word;white-space:break-spaces;overflow-wrap:anywhere;}```First_name=input("Enter Your first name:")
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

Profile icon
Equation

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

Profile icon
SakuraKimiko

@Equation
..

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

if this doesnt work I am copying the code once more

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

while True:

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

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

else:

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")

```.css-19sk4h4{position:relative;}.css-1bu6gr6{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;position:relative;}.css-1n2m10r{padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1hwur6u{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-width:0;border-style:solid;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;outline:none;min-height:0;min-width:0;padding:var(--space-8);border-radius:var(--border-radius-4);background-color:var(--background-higher);}.css-1svvr0w{height:0;}.css-rk73ff{padding:var(--space-4);padding-left:var(--space-4);padding-right:var(--space-2);font-family:var(--font-family-code);font-size:14px;line-height:var(--line-height-small);overflow-x:auto;tab-size:2;word-break:break-word;white-space:break-spaces;overflow-wrap:anywhere;}```First_name=input("Enter Your first name:")
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