Image noise: Difference between revisions

no edit summary
m (→‎{{header|Python}}: Use BitmapImage and tidy)
imported>Chinhouse
No edit summary
Line 2,436:
createdialog testrollout
</syntaxhighlight>
 
=={{header|MiniScript}}==
This implementation is for use with [http://miniscript.org/MiniMicro Mini Micro].
<syntaxhighlight lang="miniscript">
clear
tileSetLength = 240
width = 320
height = 240
cellSize = [960/width, 600/height]
colors = [color.black, color.white]
 
newImg = function
img = Image.create(tileSetLength, 1)
for i in range(0, tileSetLength - 1)
img.setPixel i, 0, colors[rnd * 2]
end for
return img
end function
 
display(5).mode = displayMode.tile
td = display(5)
td.cellSize = cellSize
td.extent = [width, height]
td.tileSetTileSize = 1
for x in range(0, width - 1)
for y in range(0, height - 1)
td.setCell x, y, rnd * tileSetLength
end for
end for
frames = 0
startTime = time
while true
td.tileSet = newImg
frames += 1
dt = time - startTime
if dt >= 1 then
text.row = 25; print "FPS: " + round(frames / dt, 2)
frames = 0
startTime = time
end if
end while
</syntaxhighlight>
[[File:minimicro-noise.jpg]]
 
=={{header|Nim}}==
Anonymous user