3 ms·
Yeah, that is the dangerous way. :) I actually really like it, oddly enough.
by taeric 5y ago
Yeah, that is the dangerous way. :)
I actually really like it, oddly enough.
- Jtsummers 5y agoI think I used it for the bingo day, too. cl-ppcre for the first line (comma separated list of numbers) and then 5x5 loops calling read over and over to fill out the bingo cards. Why jump through parsing hoops when the language will do it for you? I've also been solving them in Ada. It's not as convenient as just read, but if you instantiate an IO package for a type you can do the same kind of thing. So I made an enumeration and an IO package: type Command is (Forward, Up, Down); package Direction_IO is new Enumeration_IO(Direction); use Direction_IO; Then reading each line was just: C: Command; D: Integer; Get(File, C); Get(File, D); Other than the setup (3 extra lines), it's as easy as the Lisp version to use.
- taeric 5y agoI also had fun for the long csv lines by making a temp readtable that set comma as whitespace and then just read the numbers in.