Searching treasure in an area full of bandits [on hold]











up vote
0
down vote

favorite












def easy_level(Coins):
#This function is for the movement of the game in easy difficulty
while True:
oldcurrent=current
boardeasy[oldcurrent[0]][oldcurrent[1]]='*'
table_game_easy()
boardeasy[oldcurrent[0]][oldcurrent[1]]=' '

n = input('Enter the direction followed by the number Ex:Up 5 , Number should be < 8 n')
n=n.split()
if n[0].lower() not in ['up','left','down','right']:#Validates input
print('Wrong command, please input again')
continue
elif n[0].lower()=='up':
up(int(n[1].lower()),8)#Boundary is set to 8 as the 'easy' grid is a 8^8
elif n[0].lower()=='down':
down(int(n[1].lower()),8)
elif n[0].lower()=='left':
left(int(n[1].lower()),8)
elif n[0].lower()=='right':
right(int(n[1].lower()),8)

print("5 chests left")
print("8 bandits left")
print("Coins:",Coins)#Acts as a counter, displays the number of coins that the player has
if current[0] == Treasure1_Row and current[1] == Treasure1_Col
or current[0] == Treasure2_Row and current[1] == Treasure2_Col
or current[0] == Treasure3_Row and current[1] == Treasure3_Col
or current[0] == Treasure4_Row and current[1] == Treasure4_Col
or current[0] == Treasure5_Row and current[1] == Treasure5_Col
or current[0] == Treasure6_Row and current[1] == Treasure6_Col
or current[0] == Treasure7_Row and current[1] == Treasure7_Col
or current[0] == Treasure8_Row and current[1] == Treasure8_Col
or current[0] == Treasure9_Row and current[1] == Treasure9_Col
or current[0] == Treasure10_Row and current[1] == Treasure10_Col:
print("Hooray! You have found booty! +10 gold")
Coins = Coins+10 #Adds an additional 10 points
print("Coins:",Coins)

if current[0] == Bandit1_Row and current[1] == Bandit1_Col
or current[0] == Bandit2_Row and current[1] == Bandit2_Col
or current[0] == Bandit3_Row and current[1] == Bandit3_Col
or current[0] == Bandit4_Row and current[1] == Bandit4_Col
or current[0] == Bandit5_Row and current[1] == Bandit5_Col:
print("Oh no! You have landed on a bandit...they steal all your coins!")
Coins = Coins-Coins #Removes all coins
print("Coins:",Coins)

boardeasy[current[0]][current[1]]='*'#sets value to players position


This function is part of a python board game program. The game is a board game with chests and bandits hidden throughout the board. The function is dedicated to the "easy" section of the game (where it is a 8x8 grid).










share|improve this question









New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    You haven’t posted the complete code. The functions table_game_easy, up, down, left, right are all undefined, as are variables Treasure* and Bandit*, boardeasy and current. You should post complete code, even if you want review restricted to just one function.
    – AJNeufeld
    Nov 14 at 19:34















up vote
0
down vote

favorite












def easy_level(Coins):
#This function is for the movement of the game in easy difficulty
while True:
oldcurrent=current
boardeasy[oldcurrent[0]][oldcurrent[1]]='*'
table_game_easy()
boardeasy[oldcurrent[0]][oldcurrent[1]]=' '

n = input('Enter the direction followed by the number Ex:Up 5 , Number should be < 8 n')
n=n.split()
if n[0].lower() not in ['up','left','down','right']:#Validates input
print('Wrong command, please input again')
continue
elif n[0].lower()=='up':
up(int(n[1].lower()),8)#Boundary is set to 8 as the 'easy' grid is a 8^8
elif n[0].lower()=='down':
down(int(n[1].lower()),8)
elif n[0].lower()=='left':
left(int(n[1].lower()),8)
elif n[0].lower()=='right':
right(int(n[1].lower()),8)

print("5 chests left")
print("8 bandits left")
print("Coins:",Coins)#Acts as a counter, displays the number of coins that the player has
if current[0] == Treasure1_Row and current[1] == Treasure1_Col
or current[0] == Treasure2_Row and current[1] == Treasure2_Col
or current[0] == Treasure3_Row and current[1] == Treasure3_Col
or current[0] == Treasure4_Row and current[1] == Treasure4_Col
or current[0] == Treasure5_Row and current[1] == Treasure5_Col
or current[0] == Treasure6_Row and current[1] == Treasure6_Col
or current[0] == Treasure7_Row and current[1] == Treasure7_Col
or current[0] == Treasure8_Row and current[1] == Treasure8_Col
or current[0] == Treasure9_Row and current[1] == Treasure9_Col
or current[0] == Treasure10_Row and current[1] == Treasure10_Col:
print("Hooray! You have found booty! +10 gold")
Coins = Coins+10 #Adds an additional 10 points
print("Coins:",Coins)

if current[0] == Bandit1_Row and current[1] == Bandit1_Col
or current[0] == Bandit2_Row and current[1] == Bandit2_Col
or current[0] == Bandit3_Row and current[1] == Bandit3_Col
or current[0] == Bandit4_Row and current[1] == Bandit4_Col
or current[0] == Bandit5_Row and current[1] == Bandit5_Col:
print("Oh no! You have landed on a bandit...they steal all your coins!")
Coins = Coins-Coins #Removes all coins
print("Coins:",Coins)

boardeasy[current[0]][current[1]]='*'#sets value to players position


This function is part of a python board game program. The game is a board game with chests and bandits hidden throughout the board. The function is dedicated to the "easy" section of the game (where it is a 8x8 grid).










share|improve this question









New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    You haven’t posted the complete code. The functions table_game_easy, up, down, left, right are all undefined, as are variables Treasure* and Bandit*, boardeasy and current. You should post complete code, even if you want review restricted to just one function.
    – AJNeufeld
    Nov 14 at 19:34













up vote
0
down vote

favorite









up vote
0
down vote

favorite











def easy_level(Coins):
#This function is for the movement of the game in easy difficulty
while True:
oldcurrent=current
boardeasy[oldcurrent[0]][oldcurrent[1]]='*'
table_game_easy()
boardeasy[oldcurrent[0]][oldcurrent[1]]=' '

n = input('Enter the direction followed by the number Ex:Up 5 , Number should be < 8 n')
n=n.split()
if n[0].lower() not in ['up','left','down','right']:#Validates input
print('Wrong command, please input again')
continue
elif n[0].lower()=='up':
up(int(n[1].lower()),8)#Boundary is set to 8 as the 'easy' grid is a 8^8
elif n[0].lower()=='down':
down(int(n[1].lower()),8)
elif n[0].lower()=='left':
left(int(n[1].lower()),8)
elif n[0].lower()=='right':
right(int(n[1].lower()),8)

print("5 chests left")
print("8 bandits left")
print("Coins:",Coins)#Acts as a counter, displays the number of coins that the player has
if current[0] == Treasure1_Row and current[1] == Treasure1_Col
or current[0] == Treasure2_Row and current[1] == Treasure2_Col
or current[0] == Treasure3_Row and current[1] == Treasure3_Col
or current[0] == Treasure4_Row and current[1] == Treasure4_Col
or current[0] == Treasure5_Row and current[1] == Treasure5_Col
or current[0] == Treasure6_Row and current[1] == Treasure6_Col
or current[0] == Treasure7_Row and current[1] == Treasure7_Col
or current[0] == Treasure8_Row and current[1] == Treasure8_Col
or current[0] == Treasure9_Row and current[1] == Treasure9_Col
or current[0] == Treasure10_Row and current[1] == Treasure10_Col:
print("Hooray! You have found booty! +10 gold")
Coins = Coins+10 #Adds an additional 10 points
print("Coins:",Coins)

if current[0] == Bandit1_Row and current[1] == Bandit1_Col
or current[0] == Bandit2_Row and current[1] == Bandit2_Col
or current[0] == Bandit3_Row and current[1] == Bandit3_Col
or current[0] == Bandit4_Row and current[1] == Bandit4_Col
or current[0] == Bandit5_Row and current[1] == Bandit5_Col:
print("Oh no! You have landed on a bandit...they steal all your coins!")
Coins = Coins-Coins #Removes all coins
print("Coins:",Coins)

boardeasy[current[0]][current[1]]='*'#sets value to players position


This function is part of a python board game program. The game is a board game with chests and bandits hidden throughout the board. The function is dedicated to the "easy" section of the game (where it is a 8x8 grid).










share|improve this question









New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











def easy_level(Coins):
#This function is for the movement of the game in easy difficulty
while True:
oldcurrent=current
boardeasy[oldcurrent[0]][oldcurrent[1]]='*'
table_game_easy()
boardeasy[oldcurrent[0]][oldcurrent[1]]=' '

n = input('Enter the direction followed by the number Ex:Up 5 , Number should be < 8 n')
n=n.split()
if n[0].lower() not in ['up','left','down','right']:#Validates input
print('Wrong command, please input again')
continue
elif n[0].lower()=='up':
up(int(n[1].lower()),8)#Boundary is set to 8 as the 'easy' grid is a 8^8
elif n[0].lower()=='down':
down(int(n[1].lower()),8)
elif n[0].lower()=='left':
left(int(n[1].lower()),8)
elif n[0].lower()=='right':
right(int(n[1].lower()),8)

print("5 chests left")
print("8 bandits left")
print("Coins:",Coins)#Acts as a counter, displays the number of coins that the player has
if current[0] == Treasure1_Row and current[1] == Treasure1_Col
or current[0] == Treasure2_Row and current[1] == Treasure2_Col
or current[0] == Treasure3_Row and current[1] == Treasure3_Col
or current[0] == Treasure4_Row and current[1] == Treasure4_Col
or current[0] == Treasure5_Row and current[1] == Treasure5_Col
or current[0] == Treasure6_Row and current[1] == Treasure6_Col
or current[0] == Treasure7_Row and current[1] == Treasure7_Col
or current[0] == Treasure8_Row and current[1] == Treasure8_Col
or current[0] == Treasure9_Row and current[1] == Treasure9_Col
or current[0] == Treasure10_Row and current[1] == Treasure10_Col:
print("Hooray! You have found booty! +10 gold")
Coins = Coins+10 #Adds an additional 10 points
print("Coins:",Coins)

if current[0] == Bandit1_Row and current[1] == Bandit1_Col
or current[0] == Bandit2_Row and current[1] == Bandit2_Col
or current[0] == Bandit3_Row and current[1] == Bandit3_Col
or current[0] == Bandit4_Row and current[1] == Bandit4_Col
or current[0] == Bandit5_Row and current[1] == Bandit5_Col:
print("Oh no! You have landed on a bandit...they steal all your coins!")
Coins = Coins-Coins #Removes all coins
print("Coins:",Coins)

boardeasy[current[0]][current[1]]='*'#sets value to players position


This function is part of a python board game program. The game is a board game with chests and bandits hidden throughout the board. The function is dedicated to the "easy" section of the game (where it is a 8x8 grid).







python beginner game






share|improve this question









New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 14 at 19:09









Vogel612

21.3k346128




21.3k346128






New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 14 at 18:58









J.Peggy

1




1




New contributor




J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






J.Peggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Sᴀᴍ Onᴇᴌᴀ, Quill, vnp, AJNeufeld

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    You haven’t posted the complete code. The functions table_game_easy, up, down, left, right are all undefined, as are variables Treasure* and Bandit*, boardeasy and current. You should post complete code, even if you want review restricted to just one function.
    – AJNeufeld
    Nov 14 at 19:34














  • 2




    You haven’t posted the complete code. The functions table_game_easy, up, down, left, right are all undefined, as are variables Treasure* and Bandit*, boardeasy and current. You should post complete code, even if you want review restricted to just one function.
    – AJNeufeld
    Nov 14 at 19:34








2




2




You haven’t posted the complete code. The functions table_game_easy, up, down, left, right are all undefined, as are variables Treasure* and Bandit*, boardeasy and current. You should post complete code, even if you want review restricted to just one function.
– AJNeufeld
Nov 14 at 19:34




You haven’t posted the complete code. The functions table_game_easy, up, down, left, right are all undefined, as are variables Treasure* and Bandit*, boardeasy and current. You should post complete code, even if you want review restricted to just one function.
– AJNeufeld
Nov 14 at 19:34















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei