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 sort(mylist) | |
| recursive_sort(mylist,[]) | |
| end | |
| def recursive_sort(unsorted_array, sorted_array) | |
| if unsorted_array[1] == nil | |
| sorted_array.push unsorted_array[0] | |
| false | |
| elsif unsorted_array[0] == nil | |
| false |
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 factorial(number) | |
| if number <= 1 | |
| 1 | |
| else | |
| number * factorial(number - 1) | |
| end | |
| end | |
| def number_shuffle(number) | |
| new_array = [] | |
| number = number.to_s |
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
| #User Story2 | |
| #As a seller | |
| #I want to quickly enter purchases without manual entry | |
| #so that I can calculate the order total. | |
| #Acceptance Criteria 1 | |
| #Enter items without manual price entry | |
| #Specify the quantity of items | |
| #Return a subtotal |
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
| =begin | |
| salutations = [ | |
| 'Mr.', | |
| 'Mrs.', | |
| 'Mr.', | |
| 'Dr.', | |
| 'Ms.' | |
| ] | |
| =end | |
| salutations = [ |
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
| require 'pry' | |
| games = [ | |
| { | |
| home_team: "Patriots", | |
| away_team: "Broncos", | |
| home_score: 7, | |
| away_score: 3 | |
| }, | |
| { |
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
| $(function(){ | |
| var MemoryGame = function(){ | |
| this.init(); | |
| }; | |
| MemoryGame.prototype = jQuery.extend(MemoryGame.prototype, { | |
| init: function(){ | |
| var deck = [1,5,3,5,7,8]; |