repl.it
@adammorris/

Hangman CLI Experiment-1

Python

An experiment in seeing what would be involved in getting a command line utility that uses click package can run within repl.it

fork
loading
Files
  • main.py
  • interface.py
main.py
1
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
"""
To play normal, type `run()` at the python prompt

-then to modify the code-

Type `myrun()` at the Python prompt.
Whenever the game needs to determine if the winner won or not, runs with the code below instead of the built-in one!
"""

def is_solved(guesses: str, answer: str) -> bool:
    """
    How to make it so that this game returns True if the user has won, false if not?
    """
    print("Inside the is_solved function!")
    print(guesses, answer)
    # your code here
    print("Returning False")
    return False  # never wins :(


if __name__ == "__main__":
    """
    Don't modify the below, it makes things work :-)
    """
    from interface import cli, run, myrun; cli; run; myrun
    from interface import go; go()