Quantcast
Channel: Baanboard.com
Viewing all articles
Browse latest Browse all 4216

Just for fun

$
0
0
Hi,

this weekend I came back to the good old IOCCC (International Obfuscating C Code Contest) which is still active. Then I decided to try if I can get one of those C programs working in Baan 3GL. Here's my solution (which is not as good as the original C Version and it lacks a bit of obfuscation, but I think it's funny anyway). Can you figure out, how it works?

Regards
Günther

Code:

long F,OO
function main(){ FOO() message(sprintf$("%1.3f", 4.0*-F/OO/OO)) }
#define ; F=F-1 if -F>OO then OO=OO-1 endif
#define _  F=F-1 if F>OO then OO=OO-1 endif
#define +
function FOO()
{
            _+_+_+;
      _+_+_+_+_+_+_+_+;
    _+_+_+_+_+_+_+_+_+_+_+;
  _+_+_+_+_+_+_+_+_+_+_+_+_+;
 _+_+_+_+_+_+_+_+_+_+_+_+_+_+;
 _+_+_+_+_+_+_+_+_+_+_+_+_+_+;
_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+;
_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+;
_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+;
_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+;
 _+_+_+_+_+_+_+_+_+_+_+_+_+_+;
 _+_+_+_+_+_+_+_+_+_+_+_+_+_+;
  _+_+_+_+_+_+_+_+_+_+_+_+_+;
    _+_+_+_+_+_+_+_+_+_+_+;
      _+_+_+_+_+_+_+_+;
            _+_+_+;
}


Viewing all articles
Browse latest Browse all 4216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>