Couldn't find the text of this for a while...
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
trap("SIGINT") { exit! } | |
total_width = `stty size`.scan(/\d+/)[1].to_i # terminal width | |
snokflakes = {} | |
puts "\033[2J"; # clearing output | |
loop do | |
snokflakes[rand(total_width)] = 0 |
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
require 'set' | |
class Subway | |
attr_reader :stops | |
def initialize(lines) | |
@stops = {} | |
lines.each_pair {|line, stops| | |
stops.each do |stop| |