add retro random walker example
This commit is contained in:
parent
94ed08bd34
commit
b147168a0f
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
|
@ -0,0 +1,30 @@
|
|||
function turtle(){
|
||||
retro()
|
||||
|
||||
for (let j = 0; j < 10; j++){
|
||||
|
||||
penup()
|
||||
setpos(0,0)
|
||||
pendown()
|
||||
|
||||
for (let i = 0; i < 2000; i++){
|
||||
|
||||
penSize(randint(30))
|
||||
|
||||
if (randint()<50)
|
||||
{
|
||||
penup()
|
||||
} else
|
||||
{
|
||||
pendown()
|
||||
}
|
||||
|
||||
forward(randint())
|
||||
right(randint())
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue