import turtle
import numpy
#buat pola di sini
#kura-kura menghadap ke atas
turtle.shape("turtle")
turtle.speed(10)
turtle.left(90)
lv = 11
l = 100
dl = 3./4.
sl = 17
sr = 39
bl = 1./2.
br =1./4.
turtle.penup()
turtle.backward(l)
turtle.pendown()
turtle.forward(l)
def maju(l,level):
level += 1
turtle.backward(l*bl)
l = l*dl
turtle.left(sl)
turtle.forward(l)
if level<=lv:
maju(l,level)
#mundur, tengok kanan
turtle.backward(l)
turtle.right(sl)
turtle.forward(l*bl/dl)
turtle.backward(l*br/dl)
turtle.right(sr)
turtle.forward(l)
if level<lv:
maju(l,level)
turtle.backward(l)
turtle.left(sr)
turtle.forward(l*br/dl)
level -= 1
maju(l,2)
#agar gambar tak langsung hilang
turtle.exitonclick()
Monday, April 11, 2016
Python Turtle Assymetrical Branch
Ok, it's my last fractal this month, :D
.
Thursday, April 7, 2016
BBM Crash After Update?
Relax.
Just remove the app, and re-download it.
Solved, :)
At least at my iPhone 5 with iOS 9.3
Wednesday, April 6, 2016
Pohon Asimetris, :)
Modifikasi dari kode sebelumnya
.
import turtle import numpy #buat pola di sini #kura-kura menghadap ke atas turtle.shape("turtle") turtle.left(90) lv = 11 l = 100 sl = 47 sr = 17 turtle.penup() turtle.backward(l) turtle.pendown() turtle.forward(l) def maju(l,level): l = 3./4.*l #turtle.backward(l) turtle.left(sl) turtle.forward(l) level += 1 if level<lv: maju(l,level) turtle.backward(l) turtle.right(sl) turtle.right(sr) turtle.forward(l) if level <lv: maju(l,level) turtle.backward(l) turtle.left(sr) level -= 1 maju(l,2) #agar gambar tak langsung hilang turtle.exitonclick()
Tuesday, April 5, 2016
Fractal Tree using Python with Turtle Module
Here is "minus one" nearly symmetrical fractal tree
.
import turtle
import numpy
#buat pola di sini
#kura-kura menghadap ke atas
turtle.shape("turtle")
turtle.left(90)
lv = 7
l = 100
s = 17
turtle.penup()
turtle.backward(l)
turtle.pendown()
turtle.forward(l)
def maju(l,level):
l = 3./4.*l
turtle.left(s)
turtle.forward(l)
if level<lv:
level +=1
maju(l,level)
turtle.backward(l)
turtle.right(2*s)
turtle.forward(l)
if level<lv:
maju(l,level)
turtle.backward(l)
turtle.left(s)
level -=1
maju(l,2)
#agar gambar tak langsung hilang
turtle.exitonclick()
if we want symmetrical result, just move
level +=1
syntax
to the place before first if
Some Mistake Often Provide Beautiful Result.
:)
Planned to coding tree branch of tree, fractal mode, using turtle module on python. Has some trouble on backward rule. It become flower, by definition, it's still tree, :)
.
Planned to coding tree branch of tree, fractal mode, using turtle module on python. Has some trouble on backward rule. It become flower, by definition, it's still tree, :)
import turtle
#buat pola di sini
#kura-kura menghadap ke atas
turtle.shape("turtle")
turtle.left(90)
s = 37
lv = 7
l = 100
turtle.forward(l)
def mundur(l,level):
l = 4./3.*l
turtle.backward(l)
turtle.right(3*s)
maju(l,level)
def maju(l,level):
l = 3./4.*l
turtle.left(s)
turtle.forward(l)
level +=1
if level<=lv:
maju(l,level)
else:
mundur(l,level)
maju(l,2)
#agar gambar tak langsung hilang
turtle.exitonclick()
Friday, April 1, 2016
The Best Ever
Pulang dari kampus
Sampai rumah, buka garasi, masukkan si ducati .
"Ayah pulang"
Dibukakan pintu dalam sama Alfa, diganjal sama barbel kaki biar gak nutup lagi.
"Makasih mas "
Terdengar ketiplak-ketiplak khas kaki adek lari dari belakang
"Ibuk..., ayah pulang"
"Iya" sahut ibuk dari belakang.
Lepas baju, tinggal pake kaos warna kelabu yang diwajibkan alfa (dia protes kalo ayahnya pake warna selain kelabu dan hitam).
Mau ganti celana jeans dengan celana pendek, eh si adek sudah narik tangan.
"Ayah makan" sambil menuntun ayah ke depan
"Iya"
Di ruang depan sudah ada "tamu" lain untuk teman makan sore a la adek, penguin dan kelinci.
"Ayah ndulang penguin, adek ndulang kelinci ya" kata adek.
"Iya".
Jadilah acara pertama di rumah diisi dengan menyuapi penguin, walau perut sendiri kelaparan.
Alfa muncul,
"Adek, ayok sini"
Beta yang selalu ikut ajakan mas-nya langsung sigap meninggalkan kelincinya.
"Ayah tunggu ya"
Mereka berdua menghilang ke belakang.
Bengong sendiri,
Mau lihat tv juga paling gak boleh ubah channel sama Alfa, jam segini waktunya Kambu (eh atau Monk, atau Pororo).
Jadilah tiduran di sofa depan.
Belum semenit merasakan nikmatnya punggung yang beradu dengan sofa
Sayup-sayup terdengar langkah kaki mereka berdua dari belakang, kali ini pelan, hati-hati.
Alfa muncul, disusul Beta di belakang
"Selamat ulang tahun Ayah"
Mereka masing-masing membawa semangkuk puding.
....
"Selamat ulang tahun Yah, semoga..." Ibuk ikut nimbrung.
"Yuk nyanyi sama-sama dulu..."
....
Dan sore itu kami menikmati puding buatan ibuk berempat, di ruang depan.
Puding coklat untuk ayah, ibuk dan Beta
Alfa makan puding pink, warna favoritnya, sendirian, :)
Sore yang menyenangkan
Subscribe to:
Posts (Atom)
My sky is high, blue, bright and silent.
Nugroho's (almost like junk) blog
By: Nugroho Adi Pramono
323f
(5)
amp
(1)
android
(12)
apple
(7)
arduino
(18)
art
(1)
assembler
(21)
astina
(4)
ATTiny
(23)
blackberry
(4)
camera
(3)
canon
(2)
cerita
(2)
computer
(106)
crazyness
(11)
debian
(1)
delphi
(39)
diary
(286)
flash
(8)
fortran
(6)
freebsd
(6)
google apps script
(8)
guitar
(2)
HTML5
(10)
IFTTT
(7)
Instagram
(7)
internet
(12)
iOS
(5)
iPad
(6)
iPhone
(5)
java
(1)
javascript
(1)
keynote
(2)
LaTeX
(6)
lazarus
(1)
linux
(29)
lion
(15)
mac
(28)
macbook air
(8)
macbook pro
(3)
macOS
(1)
Math
(3)
mathematica
(1)
maverick
(6)
mazda
(4)
microcontroler
(35)
mountain lion
(2)
music
(37)
netbook
(1)
nugnux
(6)
os x
(36)
php
(1)
Physicist
(29)
Picture
(3)
programming
(189)
Python
(109)
S2
(13)
software
(7)
Soliloquy
(125)
Ubuntu
(5)
unix
(4)
Video
(8)
wayang
(3)
yosemite
(3)