I try to print some simple ascII art but none of of it shows up, what am I doing wrong? I would think this would work because the person has to input something to continue in the first place. All I am trying to do is make a simple game of rock, paper scissors. Also i am on python 3.9.4 if that has anything to do with it.
import random import time import ctypes import os def Main_Game(): y = input("Enter choice: ") b = random.choice(choices) # both put same; draw if y == b: print("Game ended with a draw!") print("Player chose = " + y + "| Bot chose = " + b) # player puts rock and bot puts paper; bot wins elif y == "rock" and b == "paper": print("Bot won the match with paper!") print("Player chose = " + y + "| Bot chose = " + b) # player puts paper and bot puts rock; player wins elif y == "paper" and b == "rock": print("Player won the match with paper!") print("Player chose = " + y + " | Bot chose = " + b) # player puts paper and bot puts scissors; bot wins elif y == "paper" and b == "scissors": print("Bot won the match with scissors!") print("Player chose = " + y + " | Bot chose = " + b) # player puts scissors and bot puts paper; player wins elif y == "scissors" and b == "paper": print("Player won the match with scissors!") print("Player chose = " + y + " | Bot chose = " + b) # player puts rock and bot puts scissors; player wins elif y == "rock" and b == "scissors": print("Player won the match with rock!") print("Player chose = " + y + " | Bot chose = " + b) # player puts scissors and bot puts rock; bot wins elif y == "scissors" and b == "rock": print("Bot won the match with rock!") print("Player chose = " + y + " | Bot chose = " + b) elif y == 'rock': print(""" _______ ---' ____) (_____) (_____) (____) ---.__(___) """) print(""" # # ##### # # # # # # # # # ##### # # # # # # # # ##### """) elif y == 'paper': print(""" _______ ---' ____)____ ______) _______) _______) ---.__________) """) print(""" # # ##### # # # # # # # # # ##### # # # # # # # # ##### """) elif y == 'scissors': print(""" _______ ---' ____)____ ______) __________) (____) ---.__(___) """) print(""" # # ##### # # # # # # # # # ##### # # # # # # # # ##### """) time.sleep(3) clear() Main_Game() clear = lambda: os.system("cls") choices = ["rock", "paper", "scissors"] ctypes.windll.kernel32.SetConsoleTitleW("Playing rock, paper, scissors!") Main_Game() https://stackoverflow.com/questions/67249382/why-is-this-not-printing-in-python April 25, 2021 at 11:05AM
没有评论:
发表评论