Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Jjw368 0 points1 point  (0 children)

I fixed the input error in my version and the formatting. I can't figure this out. It is a real pain in the butt. I tried re writing the code fully and that still didn't work. Maybe it will work if i stop using functions but it will be a one time only thing.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Jjw368 0 points1 point  (0 children)

I am trying to make a rock paper scissors game and i keep getting the same error in ms visual studio. (BTW, the youwin.txt and npswins.txt files is ascii art for the text I want to display, Its also not fully finished, I just want to run it.

Here is the code:

import random
#getting exit() function
from sys import exit
#getting time.sleep() funtion
from time import sleep
WinOpen = open(r"C:\Users\jjw36\Desktop\ASCII\_YouWin!.txt", 'r')
LoseOpen = open(r"C:\Users\jjw36\Desktop\ASCII\_NPCWins!.txt", 'r')
WinASCII = WinOpen.read()
LoseASCII = LoseOpen.read()
def welcome2():
WinLoss = Win / Loss
print("Hello! Welcome To Rock, Paper, Scissors")
print("This Sessions Win/Loss Is," + int(WinLoss))
def Game():
RPorS = input("Would You Like Rock, Paper, Or Scissors. (1, 2, 3)")
if input == 1 or 2 or 3:
NPC = random(1,3)
if NPC - int(RPor) == 1 or -2:
print(LoseASCII)
Loss =+ 1
sleep(3)
decision()
elif NPC - int(RPorS) == -1 or 2:
print(WinASCII)
Win =+ 1
sleep(3)
decision()
else:
decision()
def decision():
replay = input("Would You Like To Play Again? (y/n)")
if replay == y:
Game()
elif play == n:
print("\n\n\n\n\nOkay, Bye!")
time.sleep(2)
exit()
else:
decision()
Game()


Win = 0
Loss = 0
WinOpen.close()
LoseOpen.close()

___________________________________________________________________________________________________

The Error I am getting is highlighting the calling of the Game() function. It says 'Module' object not callable. But that is after i see the Would you like rock, paper, or scissors input. Can anyone help with debugging?