This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| def main(): | |
| welcome = ['Welcome to Hangman! A word will be chosen at random and', | |
| 'you must try to guess the word correctly letter by letter', | |
| 'before you run out of attempts. Good luck!' | |
| ] | |
| for line in welcome: | |
| print(line, sep='\n') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hangman = ( | |
| """ | |
| ----- | |
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| def main(): | |
| name = input("What's your name? ") | |
| welcome = """\ | |
| .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. | |
| | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | |
| | | _____ _____ | || | _________ | || | _____ | || | ______ | || | ____ | || | ____ ____ | || | _________ | | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # convertdate.py | |
| def main(): | |
| date = input("Enter the date mm/dd/yyyy: ") | |
| month, day, year = date.split("/") | |
| months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', | |
| 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | |
| month = months[int(month)-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # decoder2.py | |
| def main(): | |
| print("This program converts a sequence of Unicode numbers into") | |
| print("the string of text that it represents. \n") | |
| m = input("Please enter the Unicode-encoded message: ") | |
| chars = [] | |
| for n in m.split(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # decoder.py | |
| def main(): | |
| print("This program converts a sequence of Unicode numbers into") | |
| print("the string of text that it represents. \n") | |
| n = input("Please enter the Unicode-encoded message: ") | |
| message = "" | |
| for s in n.split(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoder.py | |
| def main(): | |
| print("This program converts a textual message into a sequence") | |
| print("of numberes representing the Unicode encoding of the message") | |
| m = input("Please enter the message to encode:") | |
| for ch in m: | |
| print(ord(ch), end=" ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get the button to do something | |
| package com.example.superman.ch6; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; |