Image noise: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
(→{{header|Processing Python mode}}: add sketch 2020-03 by Alexandre Villares) |
||
Line 2,359: | Line 2,359: | ||
text(frameRate, 5,15); |
text(frameRate, 5,15); |
||
}</lang> |
}</lang> |
||
=={{header|Processing Python mode}}== |
|||
<lang python>black = color(0) |
|||
white = color(255) |
|||
def setup(): |
|||
size(320, 240) |
|||
# frameRate(30) # 60 by default |
|||
def draw(): |
|||
loadPixels() |
|||
for i in range(len(pixels)): |
|||
if random(1) < 0.5: |
|||
pixels[i] = black |
|||
else: |
|||
pixels[i] = white |
|||
updatePixels() |
|||
fill(0, 128) |
|||
rect(0, 0, 60, 20) |
|||
fill(255) |
|||
text(frameRate, 5, 15)</lang> |
|||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |