Author
| Free your creativity - IOMBCC
|
DarQ msx professional Posts: 836 | Posted: February 16 2005, 18:22   |
cool... im coding something right now too.. although im not sure it will fit 80*24. It aint deliberatly obfuscated either, though my msx basic coding style is obfuscated..
what if i remove a few comments and don't tell what the code is about.. will it be worthy for this contest then? i don't think many will immediately know what its about if they only run it..
ah well, it's far from finished anyway.. it's tough mathematical matter which i don't yet understand completely.
EDIT
i checked your code... i like it  |
|
snout
 msx legend Posts: 4991 | Posted: February 16 2005, 18:28   |
Should we add a IOMBCC section to the MRC downloads database and host all BASIC listings posted here?  |
|
DarQ msx professional Posts: 836 | Posted: February 16 2005, 18:35   |
only if you make one big .dsk with all lists...
if someone feels to post a source anyway...
i do, but i might not finish whatever im coding the next few days/weeks
tough matter, little time, cannot only code in freetime, codes more than basic... you know the drill
|
|
jr msx addict Posts: 310 | Posted: February 17 2005, 13:54   |
What about this  It's not exactly an original idea or THAT obfuscated, but I thought having some "code sculpturing" would be applicable to this arena... I forgot the original author of the algorithm (it was non-sculptured C code) but credits for the algorithm go to its original author  It's not working 100% on MSX due to the accuracy of the floating point numbers I guess but it's good enough. The purpose of the program is to calculate the value of pi, and it should be able to go up to 800 digits. But like I said, it makes some errors on some of the digits and it's damn slow  Anyway, it should fit nicely on a 80x24 text screen but note that most of the lines wrap and I've broken the lines here to make it look like it does on the MSX screen when you type it in... if the formatting stays correct, that is...
1 DEFINTA -C,F-G: DEFDBLD
-E:A= 10^4: C=28* 100:: DIMF( C+1):
FOR B=0 TOC :F( B)= A/5
2 NEXT B:: REM 7*A MOD SQR
3 D=0 :G= C*2 :IF G=0 THEN
END ELSE B=C 'OR AND NOT
4 D=D +F( B)* A:G =G- 1:F
(B) =D- G * INT (D/ G):
:D= INT(D/ G):G=G -1:
5 B=B -1:IFB THEND= D*B
::: GOTO4: REM<>5 SIN
6 E=E +D/A:: IF C = 28*
100 THEN:: :PRINT STR$
(E/ 1000 );: GOTO 8:' LOG
7 ::: PRINTMID$ ((( STR$ (((
(E- INT (E) ))) *A) )),
2); ::: REM XOR 127 OUT
8 C=C -14 :E= D - A * INT
(D/ A): GOTO 3'G RUN END
(XXX) (XXX) (XXX) (XXX) (XXX) (XXX)
9 'PIcalc 'by'jr' /IOMBCC
|
|
snout
 msx legend Posts: 4991 | Posted: February 17 2005, 14:07   |
w000t!  |
|
[D-Tail]
 msx guru Posts: 3015 | Posted: February 17 2005, 14:12   |
O_o.O  |
|
Alex Ganzeveld msx lover Posts: 81 | Posted: February 17 2005, 14:28   |
Great!
|
|
NYYRIKKI msx master Posts: 1509 | Posted: February 17 2005, 14:29   |
Wow, this is cool! I have not seen such nice code sculpturing on BASIC before.  Way to go: Finland 2-0
It is definately good idea to put these to downloads, if more of these start to appear.
|
|
DarQ msx professional Posts: 836 | Posted: February 17 2005, 14:40   |
hahahaha!! that's a good laugh
EDIT!
BAH!! openmsx-catapult can't seem to type the source into the emulator.. getting syntax errors in certain lines.. |
|
viejo_archivero msx addict Posts: 440 | Posted: February 17 2005, 14:43   |
impressive!
|
|
jr msx addict Posts: 310 | Posted: February 17 2005, 15:49   |
Found the bug... Now it calcs correctly. Also, reduced the size of the code a bit in the process  Now it doesn't show the place of the decimal point though but I suppose everyone here knows where it belongs...
1 DEFINTA -C,F-G: DEFDBLD
-E:A= 10^4: C=28* 100:: DIMF( C+1):
FOR B=0 TOC :F( B)= A/5
2 NEXT B:: REM 7*A MOD SQR
3 D=0 :G= C*2 :IF G=0 THEN
END ELSE B=C 'OR AND NOT
4 D=D +F( B)* A:G =G- 1:F
(B) =D-G * INT(D/ G):
:D= INT(D/ G):G=G -1:
5 B=B -1:IFB THEND= D*B
::: GOTO 4:: REM <>5 SIN
6 :E= INT (E+ D/A ):: PRINT
MID$ ((( STR$ (E) )), 2);
7 C=C -14 :E= D - A * INT
(D/ A): GOTO 3'G RUN END
(XXX) (XXX) (XXX) (XXX) (XXX) (XXX)
8 'PIcalc 'by'jr' /IOMBCC
Yeah it's a pain in the ass to type it in  Should I upload the bas file? |
|
jr msx addict Posts: 310 | Posted: February 17 2005, 19:46   |
if you don't have the patience to wait for the processing, here's what it looks like when it's all done:
|
|
manuel online msx guru Posts: 3444 | Posted: February 17 2005, 21:29   |
Quote:
| BAH!! openmsx-catapult can't seem to type the source into the emulator.. getting syntax errors in certain lines..
|
That's because it contains End-Of-Line characters after each line. If the program would have one basic line per text line, it would work... So, you'll have to paste it a bit carefully to enter it with the help of Catapult. |
|
Grauw msx professional Posts: 1005 | Posted: February 17 2005, 22:46   |
Impressive! Though I’m missing a comma there right after the first ‘3’  ... |
|
FiXato msx freak Posts: 246 | Posted: February 24 2005, 00:11   |
Quote:
| Now it doesn't show the place of the decimal point though but I suppose everyone here knows where it belongs...
|
quoted especially for grauw
I like the idea  nice listings  |
|
|
|
|