Hi everyone,
I have a problem I can't for the life of me solve. I'm writing a Ruby app (I've been a PHP developer for 8 years, just starting with Ruby) that sells tickets for a concert hall. Each seat has a row (a...z) and a number (1...x). The database model has row (string) and num (int) for each seat.
How can I convert my array of seats from the database into a 2d array? For example, seat A1 would go into seat[1][1] = "value"; seat C4 would map to seat[3][4] = value. The issue is converting the row string to Ascii and subtracting the offset? Or is there an easier way?
Many thanks