*boggle* [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Tue 2007-10-02 09:46
*boggle*
LinkReply
[identity profile] tackline.livejournal.comTue 2007-10-02 09:06
It's more fun when you are booking a hotel and the confirmation page either doesn't appear or contains an error. You have to admire sites that tell you not to refresh pages because it might result in two bookings.
Link Reply to this | Thread
[personal profile] simontTue 2007-10-02 09:36
Nice icon. Shame about the syntax colouring :-)

(Also, the "x" at the end of the fifth line from the bottom is missing its rightmost column of pixels.)
Link Reply to this | Parent | Thread
[identity profile] tackline.livejournal.comTue 2007-10-02 12:38
Thanks. I was quite pleased with the exception handling.

I'm disappointed you didn't point out the bug(s).
Link Reply to this | Parent | Thread
[personal profile] simontTue 2007-10-02 13:31
Hmm, yes, there does seem to be a problem which I didn't initially play it for long enough to find, namely that the ball can sometimes get stuck on the LHS of the screen and bounce back and forth within the first five columns. Perhaps replace the test x%72<5 with (d>0?1:-1)*(x-40)>35 (unless that can be improved using a standard sign or abs function), so that the ball only ever bounces if it's heading out of the arena rather than on the way back into it?

And the bat isn't displayed until it first moves; you could get round that by, for example, initialising k to -1 and conditionalising the input statement on that (k=k==-1?k:System.in.available()>0?System.in.read()-44:1). Then k will be overwritten when the time is read, and so in all subsequent iterations the input check will occur (unless System.nanoTime() happens to return exactly -1, but it'll stop doing that a nanosecond later and I think that's an acceptable response lag).

Also, I had to try three or four Java compilers before I found one which didn't either fail to cope with the preamble (insisting on main() being declared explicitly) or fail to find System.nanoTime(); and once I'd compiled the program I then had to manually configure my terminal device before it was playable (stty raw isig -echo; java G; stty sane, and better still echo -ne "\033[?25l" to disable the cursor before running it, and echo -ne "\033[?25h" to re-enable it afterwards). But I assume the former was just because I had out-of-date software, and the latter an expected consequence of Java not containing a real curses library.
Link Reply to this | Parent | Thread
[identity profile] tackline.livejournal.comWed 2007-10-03 09:42
System.nanoTime is 1.5+. 1.5 has been out for around three years now. There shouldn't be a problem compiling without a main (most classes don't have a main). However, running is open to dispute. Java WebStart, for instance, does not initialise the main class as a separate step before finding and executing the main method (and it will complain if the method is defined in the wrong class loader). Terminal handling in Java is a bit limited (and available is not guaranteed to return anything other than zero), although there is Console.readPassword in 1.6.

IIRC, the getting caught in the left hand side was to do with starting position. But I forget now. I don't have many characters to spare.
Link Reply to this | Parent
[personal profile] gerald_duckTue 2007-10-02 11:04
I've had Virgin's online check-in system crash for me before now, during seat allocation. It got around to deallocating my existing seat but not allocating me a new one, then said I'd already checked in when I went back to the beginning and tried again.

I was flying from Hong Kong. The website helpfully gave me a freephone number to call about it… which didn't work from China. When I arrived at the airport that evening I had an… interesting time sorting things out.
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]