ages = [28, 32, 42, 64]
ages.map { |x| x * 2 }
ages.each { |age| puts "Age is: #{age}" }
- What is the result of the
ages.map
call? What aboutages.each
?
Tonight, you'll write a simple API with Sinatra that can play Daft Punk samples. One of you should write the API, the other person should write a client for the server with HTTParty.
For more info, see the questions.md!
Work with your teammate (see "Teams") on a shared git repository as follows:
In this assignment, we'll implement a version of tic-tac-toe that we can play from the command line. You should push what you have by Monday at 8am. Incomplete work that is on time and later refined is preferred to late work that is complete and bug-free.
I would prefer you submit the script as one file and prompt the user for different options (e.g. computer or human 2nd player, hard mode, etc.)
Please do not use Classes for this assignment. It is possible we will revisit it
# require 'pry' | |
WORDS = ["cookies", "bourbon", "dogs", "sunshine", "vacations", | |
"dictionaries", "georgia"] | |
## Pieces of data in Hangman: | |
# Guesses | |
# Answer | |
# Turn Count |
require 'pry' | |
words = [ | |
"buffalo", "sportscar", "coffee", "snazzy", | |
"childish", "futile", "authoritarian", "fantastic", | |
"beautiful", "building", "macintosh", "airport" | |
] | |
answer = words.sample | |
turn_count = answer.length |
# Pieces of data in Hangman | |
# - Answer | |
# - Guesses | |
# - Turn Count | |
require 'pry' | |
words = ["raining", "downpour", "parking", "tuesday", | |
"bourbon", "sour", "mash", "capitalism", | |
"puppies", "unicorns", "disestablishmentarianism" |
# Gets for input, puts for output | |
# data to track: | |
# letters guessed, strings | |
# turn count, number | |
# answer, string | |
# actions in hangman: | |
# inform user of word length | |
# take turns until the game ends |
Hey y'all. I want to be sure everyone is ready to roll, so here's are a few things I'd like for you to go ahead and install. Please ask if you have any trouble, or just are curious about why something works the way it does.
After each step, I'll leave a note saying how to check that it was installed properly. Please be sure to run these checks! The most common sorts of errors are commands not completing because your user lacks permission.
If that happens, feel free to flag me down and we'll get it fixed up quick! I'll assume things went smoothly unless I hear otherwise.