Jump to content

T8y8

Active Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by T8y8

  1. I recently started teaching myself python (after searching the threads for recommendations). Right now I am working on a Rock, Paper, Scissors program to mess around with if...then, definitions, and booleans, which is why the program might seem odd, I have the WIN/LOSE based off of Bool's, but I wanted to practice using them.

    Right now I'm trying to figure out a way to integrate a check to see if the player is actually putting in rock, paper, or scissors, but I haven't gotten anything to work yet. I have it checking for membership in the list picks, but I'm not sure how to make that 'reset' or try again.

    Any ideas?

    #!/usr/bin/env python
    # filename : rps.py
    
    # Author: T8y8
    # A Rock, Paper, Scissors game
    
    #Imports
    import random
    import sys
    #Define Variables
    menu = '''
    =================================
    Welcome to Rock, Paper, Scissors!
    Press enter to continue
    Quit at anytime by typing 'quit'
    =================================
    '''
    picks = ['rock', 'paper', 'scissors']
    
    #Computer Chooses
    def computerPick():
        global compChoice
        compChoice = random.choice(picks)
    #Player Chooses
    def playerPick():
        global playerChoice
        playerChoice = raw_input("Rock, Paper, or Scissors?")
        if playerChoice.lower() == 'quit':
            sys.exit()
        if playerChoice.lower() not in picks:
            print ' That is not an option'
    def choiceCompare(x, y): # X is Comp, Y is Person
        global win
        win = False
        if not win:
            if x == 'rock':
                if y.lower() == 'paper':
                    win = True
            elif x == 'paper':
                if y.lower() == 'scissors':
                    win = True
            elif x == 'scissors':
                if y.lower() == 'rock':
                    win = True
    #Show menu
    c = raw_input(menu)
    # Game Loop
    while c != 'quit':
            computerPick()
            playerPick()
            choiceCompare(compChoice, playerChoice)
            if win is True:
                print "You beat %s with %s" % (compChoice, playerChoice)
            elif playerChoice == compChoice:
                print "YOU TIED WITH %s" % compChoice
            else:
                print "You lost to %s with %s" % (compChoice, playerChoice)

  2. Could you throw some laptop specs at us?

    I run Ubuntu on my laptop almost exclusivly, running the 2.6.15-386 kernel, AIGLX + Compiz, IPW2915 wifi. Everything worked with little effort.

    I've heard Gentoo is great to really learn how linux works, but I don't think I'd recommend it as a first distro.

    Ubuntu.

  3. I've used T8y8 since my first net connection at AOL 3 or 4.0.

    Name - Tyler

    Birthyear - 1988

    After getting impatient trying to come up with some screen name that has my name in it, even at 3.0, a million Tyler's already took everything, I threw T8y8 together, and alas, T8y8 was born.

    Every English Google result for T8y8, is me. :)

    It's pronounced Tee-Eight-Why-Eight. Not Tate-Yate :(

  4. Everyone has already covered it, but yes, you can install both.

    I have Windows XP (NTFS) and Ubuntu 6.06 (JFS) installed on this laptop, each has an 18ish gig partition, and Ubuntu has a 1 gig swap partition.

  5. I have my own proxy, sadly it's spread across the school, so I'm thinking of changing it.

    If they block the new proxy, they'll be blocking a teachers website that I run.

    I win!

    On another note, my school recently blocked YouTube

    They also blocked Google's Translation feature, so you can't use that loophole

×
×
  • Create New...