Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CODE <constant string> is broken (*solved*)
#1
I was playing with some complex code from the "One Liners" stuff. The following program behaves completely differently in basic as opposed to going through the compiler. Actually, it crashes when run compiled. (I tried several different types for f and g). Oddly, at the first PLOT, there appears some other changes to the screen - a few bytes of corruption. Something weird is happening there. There are more brackets than I need - mostly in an attempt to make sure the math functions are coming out clearly. Try it in BASIN and then compile it.

I know the functions are unnecessarily complex. That's the nature of the one liner type code. Nonetheless, it ought to behave when compiled just like the interpreted version. Shouldn't it?

Code:
DIM f,g as UBYTE

1  PRINT AT 9,9;"SIMON"
3  FOR f=1 TO 4
4     INK f
5     FOR g=1 TO 32
6         PLOT INT ABS((SGN (f-2.5)*80)+24+g), INT (((CODE "0202"(f TO f)-49)*99)-48+g)
7         DRAW 32,0
8     NEXT g
9     goto 11
10  STOP
11  PRINT INK f; OVER 1;AT CODE "1919"(f TO f)-44,CODE "0099"(f to f)-41;f
12     NEXT f
13  LET f=1
14  goto 9
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)