Talk:Munching square

Latest comment: 3 years ago by Jrincayc in topic Munch as python
edit

Per Welcome to the Jargon File, it is in the public domain--SPhilbrick(Talk) 15:39, 28 February 2013 (UTC)Reply

Munch as python

edit

Here is munch written in Python (feel free to add to article if you think it useful):

import random
import turtle

y = random.randint(0,255)
width = 128 #power of two
kY = random.randint(0,width-1)
kT = random.randint(0,width-1)
for t in range(0, width):
    for x in range(0, width):
        y = ((x ^ ((t + kT) % width)) + kY) % width
        print(x,y)
        turtle.goto(x,y)

Jrincayc (talk) 12:22, 25 June 2021 (UTC)Reply