Munchausen numbers: Difference between revisions

→‎{{header|BASIC}}: Added ZX81 dialect
(Added BASIC)
(→‎{{header|BASIC}}: Added ZX81 dialect)
Line 306:
<pre> 1
3435</pre>
 
==={{header|Sinclair ZX81 BASIC}}===
Works with 1k of RAM. The word <code>FAST</code> in line 10 shouldn't be taken <i>too</i> literally. We don't have <code>DEF FN</code>, so the expression for exponentiation-where-zero-to-the-power-zero-equals-zero is written out inline.
<lang basic> 10 FAST
20 FOR I=0 TO 5
30 FOR J=0 TO 5
40 FOR K=0 TO 5
50 FOR L=0 TO 5
60 LET M=INT (I**I*SGN I+J**J*SGN J+K**K*SGN K+L**L*SGN L)
70 LET N=1000*I+100*J+10*K+L
80 IF M=N AND M>0 THEN PRINT M
90 NEXT L
100 NEXT K
110 NEXT J
120 NEXT I
130 SLOW</lang>
{{out}}
<pre>1
3435</pre>
 
=={{header|C}}==
519

edits