Tupper's self-referential formula: Difference between revisions

→‎{{header|ALGOL 68}}: Teeaks and fix typo
m (→‎{{header|Phix}}: added libheader)
(→‎{{header|ALGOL 68}}: Teeaks and fix typo)
Line 33:
Draws the bitmap using ASCII. As only integer arithmetic is used, there's no need for explicit floor operations, and the values of the right-hand side of the inequality can only be 0 or 1.
<syntaxhighlight lang="algol68">
BBEGINBEGIN CO plot Tupper's self-referential formula #
need to find x, y such that:
1/2 < floor( mod( (y/17)*2^ - ( 17x - mod(y,17) ), 2 ) )
Line 59:
print( ( " " ) )
ELSE
LONG LONG INT v := IF power of 2 > 0 THEN 0 ELSE( k + y delta ) OVER 17 FI;
IF power of 2 < 0 THEN
v OVERAB LONG LONG 2 ^ ABS power of 2
FI;
print( ( IF ODD v MODABTHEN "#" ELSE " " FI ) 2;)
print( ( IF v = 0 THEN " " ELSE "#" FI ) )
FI
OD;
3,045

edits