add simple and random walker
This commit is contained in:
parent
6315ec29d7
commit
da191ae694
Binary file not shown.
Before Width: | Height: | Size: 106 KiB |
|
@ -1,30 +0,0 @@
|
|||
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())
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
@ -1,11 +1,12 @@
|
|||
function turtle(){
|
||||
|
||||
bg('blue')
|
||||
|
||||
penColor('pink')
|
||||
penSize(12)
|
||||
|
||||
forward(randint())
|
||||
back(200)
|
||||
right(90)
|
||||
|
||||
penColor('blue')
|
||||
|
||||
for (let i = 0; i < 13; i++){
|
||||
forward(170)
|
||||
|
@ -16,6 +17,7 @@ function turtle(){
|
|||
right(10)
|
||||
|
||||
back(18)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue