From 292ee6e56555d45e6f524a0a43aa7a578df9f424 Mon Sep 17 00:00:00 2001 From: pburkart Date: Wed, 5 Jun 2019 12:02:44 -0400 Subject: [PATCH 1/6] Added solution for bin2dec app --- Solutions/Bin2Dec/bin2dec.py | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Solutions/Bin2Dec/bin2dec.py diff --git a/Solutions/Bin2Dec/bin2dec.py b/Solutions/Bin2Dec/bin2dec.py new file mode 100644 index 00000000..c2ac7e71 --- /dev/null +++ b/Solutions/Bin2Dec/bin2dec.py @@ -0,0 +1,60 @@ + +import os +import platform + +binary_values = [128, 64, 32, 16, 8, 4, 2, 1] + +def clear(): + if platform.system() == "Windows": + os.system('cls') + else: + os.system('clear') + +def header(): + clear() + print(" _ ___ _ ") + print(" \ ___ ` , __ / \ ___/ ___ ___ ") + print(" |/ \ | |' `. _-' / | .' ` .' `") + print(" | ` | | | / ,' | |----' | ") + print(" `___,' / / | /___, `___,' `.___, `._.'") + print(" ` ") + print(" A Simple Binary to Decimal Converter ") + print(" - Solution by Paul Burkart \n\n") + + convert() + +def isBinary(binary): + for i in str(binary): + if i not in '10': + return False + return True + +def fillWithZeros(binary): + zeros = 8 - len(binary) + new_binary = zeros * "0" + binary + return new_binary + +def convert(): + binary_values = [128, 64, 32, 16, 8, 4, 2, 1] + decimal_value = 0 + iterator = 0 + + binary = input("Please enter a binary value up to 8 digits long: ") + + if isBinary(binary): + if len(binary) <= 8: + binary = fillWithZeros(binary) + for i in binary: + if i == "1": + decimal_value += binary_values[iterator] + iterator += 1 + print(decimal_value) + else: + print("Error: Value is too big. Please enter an 8 digit binary value.\n") + convert() + else: + print("Error: Value isn't binary, please enter a binary value.\n") + convert() + +if __name__ == "__main__": + header() \ No newline at end of file From 652f4f34b85000b42120b3ca2b6225a493249c40 Mon Sep 17 00:00:00 2001 From: pburkart Date: Wed, 5 Jun 2019 12:18:06 -0400 Subject: [PATCH 2/6] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 899988b6..a285da37 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ authors sometimes have "writers block" it's also true for developers. This list These applications are: -- great to improve your coding skills :muscle:; -- great to experiment with new technologies 🆕; -- great to be added in your portfolio to impress your next employer/client :file_folder:; -- great to be used as examples in tutorials (articles or videos) :page_with_curl:; +- great for improving your coding skills :muscle:; +- great for experimenting with new technologies 🆕; +- great for adding to your portfolio to impress your next employer/client :file_folder:; +- great for using as examples in tutorials (articles or videos) :page_with_curl:; - easy to complete and also easily extendable with new features :ok_hand:; -This is not just a simple list of projects, but a collection that describes each project in enough detail so you can develop it from the ground up! +This is not just a simple list of projects, but a collection that describes each project in enough detail so that you can develop it from the ground up! Each project has the following **features**: From f6693feb7dd9a35b2a75593d6db306b02ee02502 Mon Sep 17 00:00:00 2001 From: pburkart Date: Wed, 5 Jun 2019 12:37:10 -0400 Subject: [PATCH 3/6] Fixed grammar --- Projects/Battleship-Bot.md | 2 +- Projects/Bin2Dec-App.md | 2 +- Projects/Bit-Masks-App.md | 2 +- Projects/Flip-Art-App.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/Battleship-Bot.md b/Projects/Battleship-Bot.md index b3391e00..22b94a6d 100644 --- a/Projects/Battleship-Bot.md +++ b/Projects/Battleship-Bot.md @@ -2,7 +2,7 @@ **Tier:** 3-Advanced -Battleship Bot is takes the [Battleship Game Engine](./Battleship-Game-Engine.md) +Battleship Bot takes the [Battleship Game Engine](./Battleship-Game-Engine.md) to the next level. This challenge uses your Battleship Game Engine to create a presentation layer using Discord's bot API to allow you to play the game via a Discord chat. diff --git a/Projects/Bin2Dec-App.md b/Projects/Bin2Dec-App.md index ff4da0ef..133699a5 100644 --- a/Projects/Bin2Dec-App.md +++ b/Projects/Bin2Dec-App.md @@ -13,7 +13,7 @@ and 1's, in any sequence and then displays its decimal equivalent. This challenge requires that the developer implementing it follow these constraints: -- Arrays may not be used contain the binary digits entered by the user +- Arrays may not be used to contain the binary digits entered by the user - Determining the decimal equivalent of a particular binary digit in the sequence must be calculated using a single mathematical function, for example the natural logarithm. It's up to you to figure out which function diff --git a/Projects/Bit-Masks-App.md b/Projects/Bit-Masks-App.md index 38634029..97843e71 100644 --- a/Projects/Bit-Masks-App.md +++ b/Projects/Bit-Masks-App.md @@ -38,7 +38,7 @@ and their timezones: - Beijing: GMT +8 - Ho Chi Mihn City: GMT +7 - Mumbai: GMT +5 -- [ ] User can see a GMT search box that an integer representing a GMT offset +- [ ] User can see a GMT search box where an integer representing a GMT offset can be entered into and a 'Find Cities' button. - [ ] User can click the 'Find Cities' button to display the names of the cities in that GMT offset in an output area. diff --git a/Projects/Flip-Art-App.md b/Projects/Flip-Art-App.md index 5aa4882c..c2ea33d9 100644 --- a/Projects/Flip-Art-App.md +++ b/Projects/Flip-Art-App.md @@ -3,7 +3,7 @@ **Tier:** 2-Intermediate Many developers have found that adding animation to an application is a -useful technique add impact to the UI, to make it more appealing to its users, +useful technique that adds impact to the UI, to make it more appealing to its users, and to explain complex subject matter. But, as a developer how do you create these and how do you know what images make effective animations? From 858e6f537344098257342516d3f40ea88946babf Mon Sep 17 00:00:00 2001 From: pburkart <37600982+pburkart@users.noreply.github.com> Date: Wed, 5 Jun 2019 12:38:31 -0400 Subject: [PATCH 4/6] Delete bin2dec.py --- Solutions/Bin2Dec/bin2dec.py | 60 ------------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 Solutions/Bin2Dec/bin2dec.py diff --git a/Solutions/Bin2Dec/bin2dec.py b/Solutions/Bin2Dec/bin2dec.py deleted file mode 100644 index c2ac7e71..00000000 --- a/Solutions/Bin2Dec/bin2dec.py +++ /dev/null @@ -1,60 +0,0 @@ - -import os -import platform - -binary_values = [128, 64, 32, 16, 8, 4, 2, 1] - -def clear(): - if platform.system() == "Windows": - os.system('cls') - else: - os.system('clear') - -def header(): - clear() - print(" _ ___ _ ") - print(" \ ___ ` , __ / \ ___/ ___ ___ ") - print(" |/ \ | |' `. _-' / | .' ` .' `") - print(" | ` | | | / ,' | |----' | ") - print(" `___,' / / | /___, `___,' `.___, `._.'") - print(" ` ") - print(" A Simple Binary to Decimal Converter ") - print(" - Solution by Paul Burkart \n\n") - - convert() - -def isBinary(binary): - for i in str(binary): - if i not in '10': - return False - return True - -def fillWithZeros(binary): - zeros = 8 - len(binary) - new_binary = zeros * "0" + binary - return new_binary - -def convert(): - binary_values = [128, 64, 32, 16, 8, 4, 2, 1] - decimal_value = 0 - iterator = 0 - - binary = input("Please enter a binary value up to 8 digits long: ") - - if isBinary(binary): - if len(binary) <= 8: - binary = fillWithZeros(binary) - for i in binary: - if i == "1": - decimal_value += binary_values[iterator] - iterator += 1 - print(decimal_value) - else: - print("Error: Value is too big. Please enter an 8 digit binary value.\n") - convert() - else: - print("Error: Value isn't binary, please enter a binary value.\n") - convert() - -if __name__ == "__main__": - header() \ No newline at end of file From 20a84d172f1d5f7fbc746692f85ab61ac172c902 Mon Sep 17 00:00:00 2001 From: pburkart Date: Wed, 5 Jun 2019 12:42:05 -0400 Subject: [PATCH 5/6] Create bin2dec.py --- Solutions/Bin2Dec/bin2dec.py | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Solutions/Bin2Dec/bin2dec.py diff --git a/Solutions/Bin2Dec/bin2dec.py b/Solutions/Bin2Dec/bin2dec.py new file mode 100644 index 00000000..c2ac7e71 --- /dev/null +++ b/Solutions/Bin2Dec/bin2dec.py @@ -0,0 +1,60 @@ + +import os +import platform + +binary_values = [128, 64, 32, 16, 8, 4, 2, 1] + +def clear(): + if platform.system() == "Windows": + os.system('cls') + else: + os.system('clear') + +def header(): + clear() + print(" _ ___ _ ") + print(" \ ___ ` , __ / \ ___/ ___ ___ ") + print(" |/ \ | |' `. _-' / | .' ` .' `") + print(" | ` | | | / ,' | |----' | ") + print(" `___,' / / | /___, `___,' `.___, `._.'") + print(" ` ") + print(" A Simple Binary to Decimal Converter ") + print(" - Solution by Paul Burkart \n\n") + + convert() + +def isBinary(binary): + for i in str(binary): + if i not in '10': + return False + return True + +def fillWithZeros(binary): + zeros = 8 - len(binary) + new_binary = zeros * "0" + binary + return new_binary + +def convert(): + binary_values = [128, 64, 32, 16, 8, 4, 2, 1] + decimal_value = 0 + iterator = 0 + + binary = input("Please enter a binary value up to 8 digits long: ") + + if isBinary(binary): + if len(binary) <= 8: + binary = fillWithZeros(binary) + for i in binary: + if i == "1": + decimal_value += binary_values[iterator] + iterator += 1 + print(decimal_value) + else: + print("Error: Value is too big. Please enter an 8 digit binary value.\n") + convert() + else: + print("Error: Value isn't binary, please enter a binary value.\n") + convert() + +if __name__ == "__main__": + header() \ No newline at end of file From 8d65f76c1b01b42b39cf60443261db8428b8d636 Mon Sep 17 00:00:00 2001 From: pburkart <37600982+pburkart@users.noreply.github.com> Date: Wed, 5 Jun 2019 12:42:51 -0400 Subject: [PATCH 6/6] Delete bin2dec.py --- Solutions/Bin2Dec/bin2dec.py | 60 ------------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 Solutions/Bin2Dec/bin2dec.py diff --git a/Solutions/Bin2Dec/bin2dec.py b/Solutions/Bin2Dec/bin2dec.py deleted file mode 100644 index c2ac7e71..00000000 --- a/Solutions/Bin2Dec/bin2dec.py +++ /dev/null @@ -1,60 +0,0 @@ - -import os -import platform - -binary_values = [128, 64, 32, 16, 8, 4, 2, 1] - -def clear(): - if platform.system() == "Windows": - os.system('cls') - else: - os.system('clear') - -def header(): - clear() - print(" _ ___ _ ") - print(" \ ___ ` , __ / \ ___/ ___ ___ ") - print(" |/ \ | |' `. _-' / | .' ` .' `") - print(" | ` | | | / ,' | |----' | ") - print(" `___,' / / | /___, `___,' `.___, `._.'") - print(" ` ") - print(" A Simple Binary to Decimal Converter ") - print(" - Solution by Paul Burkart \n\n") - - convert() - -def isBinary(binary): - for i in str(binary): - if i not in '10': - return False - return True - -def fillWithZeros(binary): - zeros = 8 - len(binary) - new_binary = zeros * "0" + binary - return new_binary - -def convert(): - binary_values = [128, 64, 32, 16, 8, 4, 2, 1] - decimal_value = 0 - iterator = 0 - - binary = input("Please enter a binary value up to 8 digits long: ") - - if isBinary(binary): - if len(binary) <= 8: - binary = fillWithZeros(binary) - for i in binary: - if i == "1": - decimal_value += binary_values[iterator] - iterator += 1 - print(decimal_value) - else: - print("Error: Value is too big. Please enter an 8 digit binary value.\n") - convert() - else: - print("Error: Value isn't binary, please enter a binary value.\n") - convert() - -if __name__ == "__main__": - header() \ No newline at end of file