Posts

Showing posts from January, 2022

Snake-Water-Game

  import random lst = [ "S" , "W" , "G" ] computer = 0 player = 0 print ( "Welcome to Snake-Water-Gun game!" ) i = 1 time_limit = int ( input ( "Rounds you want(add number): " )) print ( "Press" ) while i <= time_limit: plyr_choice = input ( "S for snake \n W for water \n G for gun \n : " ).capitalize() cmptr = random.choice(lst) # when input is s if plyr_choice == cmptr: print ( "Tie!" ) elif plyr_choice == "S" : if cmptr == "W" : print ( "You got it!" ) player += 1 elif cmptr == "G" : print ( "to Computer!" ) computer += 1 print ( f"Chances left: { time_limit - i } " ) i += 1 #when input is w elif plyr_choice == "W" : if cmptr == "S" : print ( "to Computer!" ) computer += 1 ...