Skip to content

Commit

Permalink
Tweaks to material to remove class sections (now taught through Ruby …
Browse files Browse the repository at this point in the history
…Robot world), and display more content on slides rather than loading with javascript
  • Loading branch information
dessy committed Jan 31, 2014
1 parent 7f684d8 commit 0129302
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 130 deletions.
9 changes: 9 additions & 0 deletions .class-materials/ruby-dictionary.txt
@@ -0,0 +1,9 @@
YES - true
NO - false
ANY LETTER, WORD, ETC. - string
NUMBER - integer
CATEGORY - class
COMMAND - method
ANY ITEM IN RUBY WORLD - object
STICKY NOTE - variable
ENTER KEY - \n
85 changes: 85 additions & 0 deletions .class-materials/ruby-instructions.txt
@@ -0,0 +1,85 @@
INTEGER
+ - add together
next - give the next number
even? - is the number even?
odd? - is the number odd?
round - rounds up or down to nearest integer
to_s - converts to a string
abs - absolute value
zero? - is it 0?
ceil - rounds up to the nearest integer
* - multiply two integers together
puts - displays the integer
> - greater than
< - less than
== - are they equal?
<= - less than OR equal
>= - greater than or equal
!= - not equal



STRING
+ - put the strings together
capitalize - capitalize first letter of string
upcase - make all letters capital
reverse - reverse all of the letter
chop - take off last letter of string
* - if followed by integer, repeat that many times
downcase - make everything lowercase
empty? - is the string empty?
include? - does the string include another string?
next - next letter in sequence
delete - deletes all individual letters in string
length - count the number of letters
puts - displays the string
gets - takes a string from us including the enter key
gets.chomp - takes a string without the enter key



ARRAY
each - go through each element
join(", ") - turn to string w/ comma, return original
reverse - reverse elements, return original
[x] - element at x, return original
uniq - remove duplicates, return original
delete_at(x) - remove element at x, return new array






































2 changes: 1 addition & 1 deletion assignments/loop_4.rb
@@ -1,4 +1,4 @@
99.downto(1).each do |i|
puts "#{i} bottles of beer on the wall, #{i} bottles of beer. Take one down, pass it around, and now there are #{i - 1} bottles of beer on the wall!"
puts "#{i} bottles of soda on the wall, #{i} bottles of soda. Take one down, pass it around, and now there are #{i - 1} bottles of soda on the wall!"
sleep 0.5
end

0 comments on commit 0129302

Please sign in to comment.