Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
from turtle import Turtle t = Turtle() t.speed(0) t.width(1) side = 12 pixelsPerRow = 15 # change "white" to "#f5f5f5" after completion c = ["#f5f5f5","#007f47","#747e03","#ffa18b","#de0000","#000000"] #[white, green, second green, pink, red, black] def draw(yay): for row in yay: for p in row: t.color(c[p]) t.begin_fill() for counter in range(4): t.forward(side) t.right(90) t.end_fill() t.forward(side) t.up() t.back(side * pixelsPerRow) t.left(90) t.forward(side) t.right(90) t.down() t.back(side * pixelsPerRow/2) yay = [ [0,0,0,0,1,1,1,1,1,0,0,0,0,0,0], [0,0,1,2,2,2,2,2,2,1,1,0,0,0,0], [0,1,2,3,3,3,3,3,3,2,1,1,0,0,0], [0,2,3,3,4,4,4,4,3,3,2,1,1,0,0], [0,0,4,4,5,4,4,4,4,4,3,2,1,0,0], [0,0,0,4,4,4,5,4,4,4,3,3,2,1,0], [0,0,0,0,4,4,4,4,4,4,4,3,2,1,0], [0,0,0,0,0,4,4,4,5,4,4,3,2,1,0], [0,0,0,0,0,0,4,4,4,4,4,3,2,1,0], [0,0,0,0,0,0,0,4,4,5,4,3,2,1,0], [0,0,0,0,0,0,0,0,4,4,3,3,2,1,0], [0,0,0,0,0,0,0,0,0,4,3,2,1,0,0], [0,0,0,0,0,0,0,0,0,0,2,1,0,0,0], ] draw(yay)
watermelon.py
( around 42 lines python code )
Published By:
TommyJ
Published on
2017-06-27T21:31:36Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here