This file contains 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
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
evens = [i for i in a if i % 2 == 0] | |
odds = [i for i in a if i % 2 == 1] |
This file contains 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
// Copyright Jeff Trudeau | |
require 'json' | |
require 'net/http' | |
require 'uri' | |
puts 'Welcome, a bet of -1 will end the game.' | |
earnings = 0 | |
while (true) | |
puts 'Your earnings are '.concat(earnings.to_s).concat('. Please place your bet.') | |
bet = gets.to_f |