Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobPapirov authored Apr 20, 2023
1 parent feecd6f commit d6feb54
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 0 deletions.
40 changes: 40 additions & 0 deletions ru/math/basicMath/math-add-0-13-ru.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
import random as rand # Standard library
from yachalk import chalk # pip install yachalk
import emoji as emoji # pip install emoji

from library.welcomeScreen import welcome_en as welcome
from library.farwell import showTotalScoreBye_en as showTotalScoreBye

name, questionsNum = welcome()

questionsKeeper = 1
rightAns = 0
progress = ''

while questionsKeeper <= questionsNum:

questionsKeeper += 1

mathVarA = rand.randint(0,3)
mathVarB = rand.randint(0,10)

mq1In = 999999

while mq1In != (mathVarA + mathVarB):
mq1In = int(input("{} + {} ? ".format(mathVarA, mathVarB)))
# Programme fails if enter or letters are submitted

if mq1In == (mathVarA + mathVarB):
print(" :)")
print("")
progress = str(progress) + '='
print("{}".format(progress))
print("")
rightAns += 1
break
else:
print(" :(")
print("")

showTotalScoreBye(rightAns, questionsNum, name)
44 changes: 44 additions & 0 deletions ru/math/basicMath/math-add-10-20-ru.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
import random as rand # Standard library
from yachalk import chalk # pip install yachalk
import emoji as emoji # pip install emoji

from library.welcomeScreen import welcome_en as welcome
from library.farwell import showTotalScoreBye_en as showTotalScoreBye

name, questionsNum = welcome()

questionsKeeper = 1
rightAns = 0
progress = ''

while questionsKeeper <= questionsNum:

questionsKeeper += 1

mathVarA = rand.randint(10, 20)
mathVarB = rand.randint(0, 10)

while mathVarB + mathVarA > 20:
mathVarB = rand.randint(0, 10)
else:
pass

mq1In = 999999

while mq1In != (mathVarA + mathVarB):
mq1In = input(input("{} + {} ? ".format(mathVarA, mathVarB)))

if mq1In == (mathVarA + mathVarB):
print(" :)")
print("")
progress = str(progress) + '='
print("{}".format(progress))
print("")
rightAns += 1
break
else:
print(" :(")
print("")

showTotalScoreBye(rightAns, questionsNum, name)
39 changes: 39 additions & 0 deletions ru/math/basicMath/math-add-10s-0-100-ru.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
import random as rand # Standard library
from yachalk import chalk # pip install yachalk
import emoji as emoji # pip install emoji

from library.welcomeScreen import welcome_en as welcome
from library.farwell import showTotalScoreBye_en as showTotalScoreBye

name, questionsNum = welcome()

questionsKeeper = 1
rightAns = 0
progress = ''

while questionsKeeper <= questionsNum:

questionsKeeper += 1

mathVarA = rand.randint(0,2) * 10
mathVarB = rand.randint(0,8) * 10

mq1In = 999999

while mq1In != (mathVarA + mathVarB):
mq1In = int(input("{} + {} ? ".format(mathVarA, mathVarB)))

if mq1In == (mathVarA + mathVarB):
print(" :)")
print("")
progress = str(progress) + '='
print("{}".format(progress))
print("")
rightAns += 1
break
else:
print(" :(")
print("")

showTotalScoreBye(rightAns, questionsNum, name)
44 changes: 44 additions & 0 deletions ru/math/basicMath/math-add-8-12-ru.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
import random as rand # Standard library
from yachalk import chalk # pip install yachalk
import emoji as emoji # pip install emoji

from library.welcomeScreen import welcome_en as welcome
from library.farwell import showTotalScoreBye_en as showTotalScoreBye

name, questionsNum = welcome()

questionsKeeper = 1
rightAns = 0
progress = ''

while questionsKeeper <= questionsNum:

questionsKeeper += 1

mathVarA = rand.randint(8,12)
mathVarB = rand.randint(0,4)

while mathVarA + mathVarB > 12:
mathVarB = rand.randint(0, 4)
else:
pass

mq1In = 999999

while mq1In != (mathVarA + mathVarB):
mq1In = input(input("{} + {} ? ".format(mathVarA, mathVarB)))

if mq1In == (mathVarA + mathVarB):
print(" :)")
print("")
progress = str(progress) + '='
print("{}".format(progress))
print("")
rightAns += 1
break
else:
print(" :(")
print("")

showTotalScoreBye(rightAns, questionsNum, name)
44 changes: 44 additions & 0 deletions ru/math/basicMath/math-sub-0-9-ru.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
import random as rand # Standard library
from yachalk import chalk # pip install yachalk
import emoji as emoji # pip install emoji

from library.welcomeScreen import welcome_en as welcome
from library.farwell import showTotalScoreBye_en as showTotalScoreBye

name, questionsNum = welcome()

questionsKeeper = 1
rightAns = 0
progress = ''

while questionsKeeper <= questionsNum:

questionsKeeper += 1

mathVarA = rand.randint(0,10)
mathVarB = rand.randint(0,10)

while mathVarB > mathVarA:
mathVarB = rand.randint(0, 10)
else:
pass

mq1In = 999999

while mq1In != (mathVarA - mathVarB):
mq1In = int(input("{} - {} ? ".format(mathVarA, mathVarB)))

if mq1In == (mathVarA - mathVarB):
print(" :)")
print("")
progress = str(progress) + '='
print("{}".format(progress))
print("")
rightAns += 1
break
else:
print(" :(")
print("")

showTotalScoreBye(rightAns, questionsNum, name)

0 comments on commit d6feb54

Please sign in to comment.