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 #w,b,bl,t,r,y,bla. c = ["#f5f5f5","#663300","#ffcc99","#ff0000","#ffff00","#000000","#0066ff","#663300"] 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,1,1,1,1,0,0,0,0,1,1,1,1,0,0], [0,0,1,1,1,0,0,0,0,1,1,1,0,0,0], [0,0,0,6,6,6,0,0,6,6,6,0,0,0,0], [0,2,2,6,6,6,6,6,6,6,6,2,2,0,0], [0,2,2,2,6,6,6,6,6,6,2,2,2,0,0], [0,2,2,3,6,4,6,6,4,6,3,2,2,0,0], [0,3,3,3,3,6,6,6,6,3,3,3,3,0,0], [0,0,3,3,3,6,3,3,6,3,3,3,0,0,0], [0,0,0,3,3,6,3,3,3,3,0,0,0,0,0], [0,0,0,0,2,2,2,2,2,2,2,2,0,0,0], [0,0,1,1,2,2,2,2,2,5,5,5,5,0,0], [0,0,1,2,1,1,2,2,2,2,2,5,2,2,0], [0,0,1,2,1,2,2,2,2,2,5,2,2,0,0], [0,0,0,1,1,1,2,2,2,2,5,2,0,0,0], [0,0,0,3,3,3,3,3,3,3,3,3,3,0,0], [0,0,0,0,3,3,3,3,3,3,0,0,0,0,0], ] draw(yay)
mario.py
( around 44 lines python code )
Published By:
TommyJ
Published on
2017-06-28T19:18:32Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here