loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.744343328314448","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"I1Byb2dyYW1tZXIgTmFtZTogRXJpYyBFdmFucywgTS5FZC4KI1Byb2dyYW0gTmFtZTogTnVtYmVyIEd1ZXNzZXIgKEhpL0xvIEF2ZXJhZ2UpCiNQcm9ncmFtIERlc2NyaXB0aW9uOiBVc2VzIGEgSGkvTG8gQXZlcmFnZSBhbGdvcml0aG0gdG8gZGV0ZXJtaW5lIHRoZSBudW1iZXIgY2hvc2VuIHRoZSB1c2VyLgojQWxnb3JpdGhtOiBTdGFydHMgd2l0aCBoaS9sbyBvciAxMDAvMS4gQ2FsY3VsYXRlcyBhdmVyYWdlIG9mIGhpL2xvLiBBZGp1c3RzIGhpL2xvIGFjY29yZGluZ2x5IGFmdGVyIGd1ZXNzLiBSZXBlYXQgY2FsY3VsYXRpb24gb2YgYXZlcmFnZSBiZXR3ZWVuIG5ldyBoaS9sby4gUmVwZWF0IGhpL2xvIGFkanVzdG1lbnQuLi4KIwpjb3JyZWN0ID0gIk4iCiNDcmVhdGVzIGEgdmFyaWFibGUgbmFtZWQgImNvcnJlY3QiIGFuZCBzZXRzIHRoZSBpbml0aWFsIHZhbHVlIGFzIE4KaGlnaCA9IDEwMAojQ3JlYXRlcyBhIHZhcmlhYmxlIG5hbWVkICJoaWdoIiBhbmQgc2V0cyB0aGUgaW5pdGlhbCB2YWx1ZSBhcyAxMDAKbG93ID0gMQojQ3JlYXRlcyBhIHZhcmlhYmxlIG5hbWVkICJsb3ciIGFuZCBzZXRzIHRoZSBpbml0aWFsIHZhbHVlIGFzIDEKZ3Vlc3NDb3VudCA9IDEKI0NyZWF0ZXMgYSB2YXJpYWJsZSBuYW1lZCAiZ3Vlc3NDb3VudCIgYW5kIHNldHMgdGhlIGluaXRpYWwgdmFsdWUgYXMgMQpndWVzcyA9IChoaWdoICsgbG93KSAvIDIKI0NyZWF0ZXMg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2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Programmer Name: Eric Evans, M.Ed.
#Program Name: Number Guesser (Hi/Lo Average)
#Program Description: Uses a Hi/Lo Average algorithm to determine the number chosen the user.
#Algorithm: Starts with hi/lo or 100/1. Calculates average of hi/lo. Adjusts hi/lo accordingly after guess. Repeat calculation of average between new hi/lo. Repeat hi/lo adjustment...
#
correct = "N"
#Creates a variable named "correct" and sets the initial value as N
high = 100
#Creates a variable named "high" and sets the initial value as 100
low = 1
#Creates a variable named "low" and sets the initial value as 1
guessCount = 1
#Creates a variable named "guessCount" and sets the initial value as 1
guess = (high + low) / 2
#Creates a variable named "guess" and sets the initial value as the average of high and low
while (correct == "N"):
#Starts a loop that runs as long as the variable "correct" has a value of "N".
  guess = int(guess)
  #Casts the value of the variable "guess" as an integer. This truncates any decimals.
  guessAsString = str(guess)
  #Creates a variable named "guessAsString" and sets the initial value as the value of the variable named "guess" as a string.
  print ("Is Your Number " + guessAsString + "?")
  #Outputs the current "guess" for the user to see.
  response = input("[C]orrect  /  Too [L]ow  /  Too [H]igh")
  #Creates a variable named "response" and sets the initial value as the input from the keyboard.
  if (response == "C"):
  #Start of a conditional statement if the keyboard input is "C".
    guessCountAsString = str(guessCount)
    #Creates a variable named "guessCountAsString" and sets the initial value as the value of the variable named "guessCount" as a string.
    print("Yay! I got it in " + guessCountAsString + " guesses!")
    #Outputs the line displayed when the correct number is guessed.
    correct = "Y"
    #Changes the value of the variable named "correct" to "Y".
  elif (response == "L"):
  #Start of a conditional statement if the keyboard input is "L".
    print ("Too Low Huh?")
    #Outputs an acknowledgement to the user of their input.
    low = guess + 1
    #Changes the value of the variable named "low" to the value of the current guess + 1.
    guess = (high + low) / 2
    #Changes the value of the variable named "guess" to the value of the average of high and low.
    guessCount = guessCount + 1
    #Changes the value of the variable named "guessCount" by adding 1 to its existing value.
  elif (response == "H"):
  #Start of a conditional statement if the keyboard inputs is "H".
    print ("Too High Huh?")
    #Outputs an acknowledgement to the user of their input.
    high = guess - 1
    #Changes the value of the variable named "high" to the value of the current guess - 1.
    guess = (high + low) / 2
    #Changes the value of the variable named "guess" to the value of the average of high and low.
    guessCount = guessCount + 1
    #Changes the value of the variable named "guessCount" by adding 1 to its existing value.
print ("Exiting Program")
#Outputs a message letting the user they are exiting the program.