Problems? Is your data what you think it is? | |
PerlMonks |
Vertical number representation for Turing Machine tape display?by eric.foxx (Novice) |
on Sep 20, 2008 at 21:55 UTC ( [id://712774]=perlquestion: print w/replies, xml ) | Need Help?? |
eric.foxx has asked for the wisdom of the Perl Monks concerning the following question: I am creating a quite complex format that will show the tape contents of a Turing Machine. I want to be able to show the user where on the tape we are, in a cleanly formatted area above the tape itself. Here is an 80-column example (truncated to save other monks' weary eyes):
I have looked at many of the usual subjects on this topic, including perlform and Sage's Perl Practicum, but it may just be possible that I'm the first weirdo to need something like this!
Right now, I'm taking the log(10) of the largest number (264 in this example) to determine how many lines the numbers will take up vertically. After that, I have to compose the format dynamically and eval it later. Is this the best way? Any better ideas or refinements?
Back to
Seekers of Perl Wisdom
|
|