![]() |
|
100 Program Challenge..For everyone - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: 100 Program Challenge..For everyone (/Thread-100-Program-Challenge-For-everyone) Pages:
1
2
|
100 Program Challenge..For everyone - insidious - 04-27-2016 Hey all, I am slowly starting to work on 4-chans program challenge at my website again, but I figured I'd post the actual challenges here and see what happens ![]() that's it. Use whatever language you want. This isn't so much who will win or the best solution, but what you guys can do and a collaborative learning effort. Collab with others if you want, the point is to learn something new. For example, when I'm trying to learn a new language I randomly choose a few of these to do, and come out with a greater understanding and a few tips/tricks up my sleeve. The last two numbers of your post count is your assignment GO I'll be doing 35, which is my post-count before I posted this. 36 later since that's my post count when I posted this. I'll be using C | Python respectively P.S This is from 4chan RE: 100 Program Challenge..For everyone - Slacker - 05-13-2016 Are #'s 29 or 30 something I would be able to watch a few video tutorials on and try to jump in it balls deep? I would be interested in trying this but would need a nudge in the right direction. RE: 100 Program Challenge..For everyone - Mafia - 05-13-2016 There are some nice challenges here! I will attempt a few tonight! This would be good for people who are trying to start a specific language and want to learn in a more practical way. RE: 100 Program Challenge..For everyone - Inori - 05-13-2016 Totally not doing all of them as we speak.. (also, tag this thread with the serenity prefix) RE: 100 Program Challenge..For everyone - insidious - 05-13-2016 (05-13-2016, 08:56 AM)Slacker Wrote: Are #'s 29 or 30 something I would be able to watch a few video tutorials on and try to jump in it balls deep? I would be interested in trying this but would need a nudge in the right direction. Hellya man. It's great for learning new things, and 29/30 shouldn't be too bad for getting your feet wet. Just keep going once the goings get tough, and you'll make it out alive. (05-13-2016, 09:04 AM)Mafia Wrote: There are some nice challenges here! I will attempt a few tonight! This would be good for people who are trying to start a specific language and want to learn in a more practical way. Thanks man haha. And yeah I use these challenges alot when I'm trying to learn a new language. I grab a few random ones and get to it, and it gives me a pretty good idea of the strengths/weakness' of the langauge, as well as getting me acclimated to it. (05-13-2016, 11:56 AM)Inori Wrote: Totally not doing all of them as we speak.. I'll want to see the result of that! ![]() (tagged )
RE: 100 Program Challenge..For everyone - Slacker - 05-13-2016 Like I haven't messaged with this at all before that's why I was asking. RE: 100 Program Challenge..For everyone - Oni - 05-13-2016 I'll try and do Hangman.
RE: 100 Program Challenge..For everyone - Inori - 05-13-2016 (05-13-2016, 11:16 PM)Oni Wrote: I'll try and do Hangman. Spoiler: python versionCode: from random import randint
from os import system
def cls():
if __import__('os').name=="nt": system('cls')
else: system('clear')
words=["animal","vast","brilliant","exit","passenger","binding","loyal","cold","generation","cruise","abstract","raspberry","prime","red","episode","forgotten","dust","virgin","alien","focus","tactic","cut","pink","skin","goggles","crawling","heart"]
word=list(words[randint(0,len(words)-1)])
disp=['_']*len(word)
left=12
guessed=[]
while left>=0:
cls()
print("Guesses left:\t "+str(left)+"\nAlready guessed:",', '.join(guessed),"\nProgress:\t",' '.join(disp),"\n\n")
guess=input("Guess a letter: ")
while guess in guessed or len(guess)>1:
guess=input("Invalid option. Choose another letter: ")
guessed.append(guess)
if word.count(guess)>0:
for i in range(len(word)):
if word[i]==guess: disp[i]=guess
if disp==word:
print("\nYou Win! The word is "+''.join(word))
exit()
else:
left-=1
print("Out of guesses, you lose. The word was "+''.join(word))RE: 100 Program Challenge..For everyone - insidious - 05-29-2016 Made the currency program in Python. Used an API b/c i have not really used API's much (never in Python) before and wanted to learn a bit more about how they work since they are extremely useful... Code: import json
import urllib3
import sys
#this is my first time using API :D
http = urllib3.PoolManager()
r = http.request('GET','http://api.fixer.io/latest?base=USD')
with open('result.json','wb') as out:
out.write(r.data)
r.release_conn()
with open('result.json') as data_file:
data = json.load(data_file)
while True:
rate = input("Enter the rate you would like to see, in official format (or :q to exit..)EX: PLN or USD: ")
if (rate == 'USD'):
multiplier = input("Enter how much in USD you would like to convert to chosen currency: ")
print("%d %s is %d %s" % (int(multiplier), 'USD', int(multiplier), 'USD'))
elif(rate == ':q'):
sys.exit(0)
else:
try:
convRate= data['rates'][rate]
multiplier = input("Enter how much in USD you would like to convert to chosen currency: ")
print("%d %s is %d %s" % (int(multiplier), 'USD', convRate * int(multiplier), rate))
except KeyError:
print("Whoops! That was not a valid format. Try Again...")RE: 100 Program Challenge..For everyone - Rick - 06-04-2016 le rolling fur dubbles!!!!!!!!! (I got 62 and will update this post when le done) |