Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Python/task/Aneesh Pradhan/SS1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Python/task/Aneesh Pradhan/SS2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Python/task/Aneesh Pradhan/SS3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions Python/task/Aneesh Pradhan/ludo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import random
goal=50
a=0
b=0
def randnum():
c=random.randint(1,6)
return c
while(a!=50 or b!=50):
print("Player A turn")
d=input("press y : ")
if(d=="y"):
outcome=randnum()
print("your choice : ", outcome)
a+=outcome
if a==goal:
print("PLAYER_1 wins")
break
elif a>goal:
a-=outcome
print("A present score : ",a)
print("Player_B turn")
e=input("press y : ")
if(e=="y"):
outcome=randnum()
print("your choice : ", outcome)
b+=outcome
if b==goal:
print("PLAYER_2 wins")
break
elif b>goal:
b-=outcome
print("B present score : ",b)