Created
June 26, 2012 17:56
-
-
Save chadwickdonald/2997485 to your computer and use it in GitHub Desktop.
assess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def new_cat(string1, string2) | |
| new_string = string1 + string2 | |
| end | |
| new_cat("Chad", "Bidwell") | |
| def sum(numbers) | |
| sum = 0 | |
| numbers.each {|num| sum += num} | |
| sum | |
| end | |
| for ["ruby", "is", "the", "best", "programming" ,"language", "ever"] | |
| index 3 = "best" | |
| "ruby" is at index 0 | |
| length = 7 | |
| class String | |
| def fun_string! | |
| string_ar = self.split("") | |
| i = 1 | |
| new_string ="" | |
| string_ar.each do |letter| | |
| if i%2 == 0 | |
| new_string << letter.upcase | |
| end | |
| i++ | |
| end | |
| self = new_string.reverse | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment