Jump to content

Fishstick

Member
  • Posts

    14
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Fishstick got a reaction from Julio860JVL in The under 100 line challenge!   
    I made a Python command line version of Deal or No Deal in exactly 100 lines.
     
    Download a executable version here. Just extract all the files in the zip and run DealOrNoDeal.exe from console. Unfortunately in the end of the game there is no pause and the window closes. I will work on fixing that.
    http://filesmelt.com/dl/deal_or_no_deal.7z
     
     

     

    from colorama import Fore, Back, Stylefrom termcolor import coloredimport colorama, random, os, syscolorama.init()values = [ 0.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750, 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 750000, 1000000 ] cases = []choice = 0round = 1class Case: def __init__(self, number, value): self.number = number self.value = value self.active = True def print_cases(x): os.system('cls') print('') for i in range(0, 13): if not values[i] == 0: a = ' $' + ' '*( 5 - len(str(values[i]))) + str(values[i]) + ' ' else: a = ' '*8 if not values[i + 13] == 0: b = ' $' + ' '*( 8 - len(str(values[i+13]))) + str(values[i+13]) + ' ' else: b = ' '*11 print( '\t\t\t' + colored(a, 'grey', 'on_yellow') + ' ' + colored(b, 'grey', 'on_yellow'), end='') if i == 6: print('\tYour Case', end='') if i == 7 and not choice == 0: print( '\t' + colored(' ' + str(choice) + ' '*(4-len(str(choice))), 'grey', 'on_yellow'), end='' ) print('') print('\n') for i in range(0, 26): if(x[i].active): print( colored(' ' + str(x[i].number) + ' '*(4-len(str(x[i].number))), 'grey', 'on_yellow'), end='\t') else: print(colored(' ', 'grey', 'on_yellow'), end='\t') if( i == 19): print('\n\n\t\t', end='') elif( i == 9): print('\n') def setup_cases(): r = list(values) random.shuffle(r) for i in range(0,26): cases.append( Case( i + 1 , r[i] ) ) def get_offer(): total, a = 0, 0 for x in cases: if x.number == choice or x.active: a += 1 total += x.value return int((total/a) * (round/10))setup_cases()print_cases(cases)while choice < 1 or choice > 26: choice = int(input('\n\nChoose a case (1 - 26): '))for x in cases: if x.number == choice: x.active = Falseprint_cases(cases)while round < 10: p = 7 - round if p < 1: p = 1 for i in range(0, p): print('\nPick ' + str(p) + ' cases this round') x = 0 while x < 1 or x > 26 or not cases[x-1].active: x = int(input('\n' + str(i + 1) + ': ')) for j in cases: if j.number == x: print('Case ' + str(x) + ': ' + str(j.value)) values[values.index(j.value)] = 0 j.active = False input('Press Enter to continue...') print_cases(cases) print('\nThe bank offers ' + str(get_offer())) d = input('Deal or No Deal? ') if d.lower() == 'deal': print ('Congratulations! You\'ve won $' + str(get_offer())) sys.exit(0) input('Press Enter to continue...') print_cases(cases) round += 1 for x in cases: if x.active and not x.number == choice: val = x.valueprint('\n\nThe last case contained $' + str(val) + '\nCongratulations! You stuck with your case and won $' + str(cases[choice-1].value))
  2. Like
    Fishstick got a reaction from Harbinger in LG G3 Review and.... TWENTY-FIVE Phone Giveaway?!   
    That screen looks awesome. I think I can handle it's girth.
  3. Like
    Fishstick got a reaction from flibberdipper in How fast is the LTT member's internet connection?   
    This is the best result I've gotten at school but I'm at home for break now....
     

  4. Like
    Fishstick got a reaction from MikkoP in How fast is the LTT member's internet connection?   
    This is the best result I've gotten at school but I'm at home for break now....
     

  5. Like
    Fishstick reacted to Fetzie in most unused keyboard key?   
    Windows key + pause/break calls up the system information panel.
  6. Like
    Fishstick reacted to rainbrodash666 in Experiences with non-techies   
    so this one time I was hanging out with my friend who is the manager at a tech shop by where I live and a girl comes in and buys a 2tb hard drive. we let her know that we install hard drives for $1 (the cost of the sata cable we use) and she says "just because I am a woman does not mean I cant work on computers" and leaves in a huff. two days later she comes back in saying that the HDD is not working so we take the computer in to look at it, we open it and the HDD is nowhere to be seen, so we ask her where it is. and it turns out that she scanned it and put the scanned image on her desktop to install the drive. and to top that off she threw away the drive she paid almost $200 for and she wanted us to give her a new one.
     
     
     
    EDIT: feel free to quote this comment, I like seeing peoples reactions even though the comment is 2+ years old.
    EDIT EDIT: still funny in 2021 keep em comin'
×