From 65c4542f964e744111a6b38875091f4e0ea87903 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Sat, 21 Aug 2021 15:23:37 -0400 Subject: [PATCH 1/2] commit lots of code --- .idea/.gitignore | 3 ++ .idea/100DaysOfPython.iml | 10 +++++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ Hangman.py | 22 ++++++++++ Hurdle4_Task.py | 41 +++++++++++++++++++ 8 files changed, 100 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/100DaysOfPython.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Hangman.py create mode 100644 Hurdle4_Task.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/100DaysOfPython.iml b/.idea/100DaysOfPython.iml new file mode 100644 index 0000000..081c358 --- /dev/null +++ b/.idea/100DaysOfPython.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..cec1829 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3c92a27 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Hangman.py b/Hangman.py new file mode 100644 index 0000000..9c809fe --- /dev/null +++ b/Hangman.py @@ -0,0 +1,22 @@ +import random + +# Create a List + +word_list = ["aardvark", "baboon", "camel"] + +# Randomly select the word in the list to a variable + +chosen_word = random.choice(word_list) + +# Print out the Guess Letter +print("Guess a Letter: ", end="") + +# Take input from the user from the Keyboard +guess = input() + +# change the input character from Capital letter to Lowercase letter of the use input +guess = guess.lower() + + +print(chosen_word) +print(guess) \ No newline at end of file diff --git a/Hurdle4_Task.py b/Hurdle4_Task.py new file mode 100644 index 0000000..0581867 --- /dev/null +++ b/Hurdle4_Task.py @@ -0,0 +1,41 @@ +def turn_right(): + turn_left() + turn_left() + turn_left() + + +def jump(): + turn_left() + move() + turn_right() + move() + turn_right() + move() + turn_left() + + +def jump_high(): + turn_left() + move() + turn_right() + + +def down(): + move() + turn_right() + + +while not at_goal(): + while not wall_on_right(): + turn_right() + move() + if wall_in_front() and not right_is_clear(): + turn_left() + if wall_on_right() and wall_in_front(): + jump_high() + if front_is_clear(): + down() + if not front_is_clear(): + turn_left() + else: + move() \ No newline at end of file From 60759d5abcd16bb7bb646977834377c0c7ef41ee Mon Sep 17 00:00:00 2001 From: pythonboi Date: Mon, 23 Aug 2021 18:04:58 -0400 Subject: [PATCH 2/2] update code --- Exercise.py | 3 +++ Hangman.py | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 Exercise.py diff --git a/Exercise.py b/Exercise.py new file mode 100644 index 0000000..2387f66 --- /dev/null +++ b/Exercise.py @@ -0,0 +1,3 @@ +a = 5 +b = a += 2 +print(a) \ No newline at end of file diff --git a/Hangman.py b/Hangman.py index 9c809fe..c44356f 100644 --- a/Hangman.py +++ b/Hangman.py @@ -8,8 +8,13 @@ chosen_word = random.choice(word_list) +# Creating an empty list +display = [] + +print(chosen_word) + # Print out the Guess Letter -print("Guess a Letter: ", end="") +print("Guess a Letter: ", end="") # Take input from the user from the Keyboard guess = input() @@ -17,6 +22,28 @@ # change the input character from Capital letter to Lowercase letter of the use input guess = guess.lower() +count = 0 -print(chosen_word) -print(guess) \ No newline at end of file +for char in chosen_word: + # display += "_" + display.append("_") +print(display) + +# for num in range(len(chosen_word)): +# # for check in chosen_word: +# count = count + 1 +# print(count) +for check in range(len(chosen_word)): + if guess in chosen_word[check]: + display[check] = guess + + + # for check in chosen_word: + # # print(num) + # if guess in check: + # print(num) + # print("Yes") + # else: + # print("No") + +print(display)