Skip to content

Instantly share code, notes, and snippets.

@drio
Created October 24, 2008 21:36
Show Gist options
  • Save drio/19602 to your computer and use it in GitHub Desktop.
Save drio/19602 to your computer and use it in GitHub Desktop.
# Read first line and order the input
l1 = File.open("./input.txt", "r").read.split[1].split(',')
# Create a struct class to hold the stats per lane
line_stats = Struct.new(:c, :d, :a, :b)
# Instantiate a stat lines with the input data
l1_stats = line_stats.new(*l1)
# Display the contents of the struct
puts l1_stats.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment