- screenshots of scores will be posted in comments
- screenshots of completed sections will be posted in comments
- Did you run into any issues? no
- How do you open Atom from your Terminal? atom
- What is the file extension for a Ruby file? rb
- What is the Atom shortcut for hiding/ showing your file tree view?
- What is the Atom shortcut for quickly finding a file (fuzzy finder)?
- screenshots of your terminal after each exercise will be posted in comments
Day One Questions:
- What does pwd stand for, and how is this command helpful? pwd stands for print working dictionary and it's helpful because it allows you to see what directory you're in if you get lost while you're working.
- What does hostname tell you, and what shows up in YOUR terminal when you type hostname? The hostname command tells you your computer's network name. Daniels-MBP.domain shows up when I type this command.
IRB
- How do you start and stop irb? irb to start and exit to stop
- What might you use irb for? to experiment with small pieces of code to see if certain features will work before using them in your program
Variables
- How do you create a variable? type the name of the variable on the left side, then a = , and the desired value on the right
- What did you learn about the rules for naming variables? variables cannot start with numbers or contain dashes and it must contain letters
- How do you change the value of a variable? to change the value of a variable name simply type the name of the variable followed by a = and assign the new value on the right side
Datatypes
- How can you find out the class of a variable? .class
- What are two string methods? include? downcase!
- How can you change an integer to a string? to_s
Strings
- Why might you use double quotes instead of single quotes in Ruby? You would want to use double quotes when you need to use string interpolation
- What is this used for in Ruby: #{}? String Interpolation: Used to plug in a variable into a string
- How would you remove all the vowels from a string? Use .delete methods and 'aeiou'' inside of ()
Input & Output
- What do 'print' and 'puts' do in Ruby? Displays a string to the user of the program
- What does 'gets' do in Ruby? gets input from user and leaves a space after
- Add a screenshot in the comments of the program you created that uses 'puts' and 'gets', and give it the title, "I/O".
Numbers & Arithmetic
- What is the difference between integers and floats? floats contain decimals
- Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".
Booleans
- What do each of the following symbols mean?
- == equals
-
= greater than or equal to
- <= less than or equal to
- != not equal to
- && and
- || or
- What are two Ruby methods that return booleans? .end_with? and .include?
Conditionals
- What is flow control? when code makes decisions for us
- What will the following code return? Not many apples...
apple_count = 4
if apple_count > 5
puts "Lots of apples!"
else
puts 'Not many apples...'
end
- What is an infinite loop, and how can you get out of one? a loop that never stops because the condition being tested is never met, Ctrl + C to get out of it
- Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".
nil
- What is nil? nothing
- Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "nil".
Symbols
- How can symbols be beneficial in Ruby? symbols are useful when trying to save memory within a program
- Does naming symbols use the same rules for naming variables? as far as I can tell yes
- Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".
Arrays
- What method can you call to find out how many elements are in an array? .length
- What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]? 0
- What do 'push' and 'pop' do? push adds an element to the end of an array and pop removes it and returns the value
Hashes
- Describe some differences between arrays and hashes. arrays only require a value while hashes require a key and a value
- What is a case when you might prefer an array? What is a case when you might prefer a hash? I think I would prefer a hash when storing data that is related to each other or when they share the same properties
-
- Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".
- Were you able to get through the work? Did you rush to finish, or take your time?
- What are you most looking forward to learning more about?
- What topics would you most like to see reinforced by instructors?
- What is most confusing to you about what you've learned?
- What questions do you have for your student mentor or for your instructors?
(Note: You will most likely only get to the following sections if you have more than a week for your pre-work. If you are doing the one week pre-work schedule, you may delete this section of the Gist.)
- Loops: Take a screenshot of your "Challenge" program, and post it as a comment in your Gist.
- What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs.
- Functions: How do you call a function and store the result in a variable?
- Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.
- How to Write a Program: Screenhero with your student mentor and share your program. Write a bit about what you found most challenging, and most enjoyable, in creating your program.
- screenshots will be posted in comments
- What are your three biggest takeaways from working through this book?
- screenshots will be posted in comments
- What are your two biggest takeaways from working through this tutorial?
- What is one question you have about Git & GitHub?
- Describe your thinking on effective workflow. What shortcuts do you think you'll find most useful? What would you like to learn or practice that will most help you improve your speed and workflow?
As you complete each section, respond to the related questions below (mostly taken directly from the tutorial exercises):
- 1.3: By reading the "man" page for echo, determine the command needed to print out “hello” without the trailing newline. How did you do it? echo -n "hello"
- 1.4: What do Ctrl-A, Ctrl-E, and Ctrl-U do? Ctrl-A takes you to the beginning, Ctrl-E takes you to the end, and Ctrl-U clears the command and lets us start over
- 1.5: What are the shortcuts for clearing your screen, and exiting your terminal? Ctrl-L and Ctrl-D
- 2.1: What is the "cat" command used for? What is the "diff" command used for? cat is used to print the contents of a file in the terminal and diff is used to compare two files that are not exactly the same
- 2.2: What command would you use to list all txt files? What command would you use to show all hidden files? ls *.txt and ls -a
- 3.1: How can you download a file from the internet, using the command line?
- 3.3: Describe two commands you can use in conjunction with "less".
- 3.4: What are two things you can do with "grep"?
Task A - Screenshot of typing scores from 8/23
