Anonymous user
Pseudorandom number generator image: Difference between revisions
Pseudorandom number generator image (view source)
Revision as of 15:58, 16 January 2022
, 2 years agoAdded Forth entry
m (→{{header|Phix}}: added syntax colouring, marked p2js incompatible) |
(Added Forth entry) |
||
Line 128:
size sq 3 * [ 256 random ] B{ } replicate-as >>bitmap
image-window</lang>
=={{header|Forth}}==
{{works with|gforth|0.7.3}}
Uses gforth random generator to create PBM portable pixmap image file.
<lang forth>require random.fs
: prngimage
outfile-id >r
s" prngimage.pbm" w/o create-file throw to outfile-id
s\" P1\n500 500\n" type
500 0 do
500 0 do
2 random 48 + emit
loop #lf emit
loop
outfile-id close-file throw
r> to outfile-id ;
prngimage</lang>
=={{header|Go}}==
|