CS175 Spring 2010
P2 - XHTML Page
Johnathan Roatch

Table of Contents

  1. My Interests
  2. Various Things to Pass the Assessment
    1. ASCII art
    2. A Table
    3. A Quote
    4. Some Web Definitions
    5. Misc.
  3. Rock Paper Sissors Python Code
  4. Other Classmates Pages

My Interests

[walking through the halls of school]

I am a DMA student at Huntington University. My home in in New Creek, West Virginia, and I like video games. I hope to learn something while taking this web scripting class.

The picture above is from the my last attempt to make a video game. I participate in a programing competition called SpeedHack. The point of the competition is to make a simple game in 72 hours using the Allegro game programing library. I didn't get to complete the game as was trying to learn the latest beta version of Allegro.

Recently the ipad came out, I'm not too pleased that it's just a bigger ipod touch, especially since the ipod touch/iphone had quite a few misfeatures. What happen to the vision that most people had when multi-touch technology was introduced?

Come see our latest restriction.


Various Things to Pass the Assessment

ASCII art

            ,
          ,/ \,
        ,/ \,/ \
       / \,/ \,/|
      |\,/|\,/|/ \,
      |\|/ \|/ \,/ \
     / \|\,/ \,/ \,/|
    |\,/ \|\,/|\,/|/|
   / \|\,/|\|/ \|/|/|     [#]
  |\,/|\|/|\|\,/|/|/       | @
   \|/ \|/ \|\|/|/         o/7>
             \|/             |
                            / \
__________________________________
  DR. TOPPER: Now we'll see if you
   can REALLY count. You've got 
   20 seconds....READY?

A Table

My Class Schedule
Time Monday Tuesday Wednesday Thursday Friday
8:00 AM
9:00 AM DM160-03
10:00 AM CAP475-02 Chapel CAP475-02 Chapel
11:00 AM CS175-01 CS175-01 CS175-01 Chapel
12:00 AM PY111-01 PY111-01 PY111-01
1:00 PM CO215-04 CO215-04 CO215-04
2:00 PM
3:00 PM
4:00 PM
5:00 PM Dinner
6:00 PM DM375-02 DM375-02
7:00 PM
8:00 PM
9:00 PM Ekklesia
10:00 PM

Some Web Definitions

Computer
A programmable device that performs mathematical calculations and logical operations, especially one that can process, store and retrieve large amounts of data very quickly.
internet
Any set of computer networks that communicate using the Internet Protocol. (An intranet.)
Internet
The specific internet consisting of a global network of computers that communicate using Internet Protocol (IP) and that use Border Gateway Protocol (BGP) to identify the best paths to route those communications.
World Wide Web
Collectively, all of the web pages on the Internet which hyperlink to each other and to other kinds of documents and media.
Definitions from wiktionary

A Quote

Robert Millan's e-mail signature

The DRM opt-in fallacy: Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all.

Misc.

Fibonacci sequence: Fn = Fn-1 + Fn-2

Pythagorean theorem: a2 + b2 = c2

The computer is a moron. —Peter Drucker


Rock Paper Sissors Python Code

Download rps.py

#!/usr/bin/env python

import random

ROCK, PAPER, SCISSORS, QUIT = 0, 1, 2, -1

opponent_history = []
player_history = []
opponent_score = 0
player_score = 0
in_play = True

# henny adapted from http://webdocs.cs.ualberta.ca/~darse/rsbpc.html
def henny_move():
  win_move = [PAPER, SCISSORS, ROCK]
  if not player_history:
    return random.choice((ROCK, PAPER, SCISSORS))
  else:
    return win_move[random.choice(player_history)]
    
def player_move():
  move_number = {'r': ROCK, 'p': PAPER, 's': SCISSORS, 'rock': ROCK,
                 'paper': PAPER, 'scissors': SCISSORS,
                 'q': QUIT, 'quit': QUIT, 'exit': QUIT}
  while True:
    try:
      player_input = move_number[raw_input("your move: ")]
      break
    except KeyError:
      print 'Choose from "rock", "paper", or "scissors". "quit" will quit'
    except EOFError:
      player_input = QUIT
      break
  return player_input


print "Welcome to a Rock Paper Sissors demo. Type quit to exit."
move_names = ['rock', 'paper', 'scissors']

while in_play:
  opponent_choice = henny_move()
  player_choice = player_move()
  if player_choice == QUIT:
    in_play = False
  else:
    print "computer's move:", move_names[opponent_choice]
    if (player_choice, opponent_choice) in ((ROCK, PAPER), (PAPER, SCISSORS), (SCISSORS, ROCK)):
      print "you lose"
      opponent_score += 1
    elif (player_choice, opponent_choice) in ((PAPER, ROCK), (SCISSORS, PAPER), (ROCK, SCISSORS)):
      print "you win"
      player_score += 1
    else:
      print "draw"
  player_history.append(player_choice)
  opponent_history.append(opponent_choice)

print "you:", player_score, ",computer:", opponent_score

Other Classmates Pages


Validate XHTML

Copyright © 2010 Johnathan Roatch