ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >§?!!3333PUPUUA@UUPUUUPUUUA@UUUUUPPPPPUUDDUUUUUPPPPUUDDUPUPUPUPUUPPU0#20#23UU33UU3!B$B$B$!B$B$B$3333A40CA40CU33UU33U@40C@40CD33DD33D!ATE40CTE!!ATE40CTE!33U333333U3333U333333U33A "@D@D "@A "@D@D "@UD"D"D"DD"D"D"DUUD"D"D"DD"D"D"DU0 00 033""3333""33!B0 B$0@$!B0 B$0@$3D33""33D33D33""33D3A4C0 " "0A4CA4C0 " "0A4CUU33"D""D"33UUUU33"D""D"33UU @0#@ 2@  @0#@ 2@ ""DD3U"DD"U3DD""""DD3U"DD"U3DD""!!B$B$!!B$B$!!B$B$!!!B$B$!!B$B$!!B$B$!3333333333333333333333333333A000000@A000000@UD333333333333DUUD333333333333DU0C400000000000C40C400000000000C4333333333333333333333333333333333333333333333333!BD$B@$BD$!BD$B@$BD$3"DD"33"DD"3A4#"@D@D "2CA4#"@D@D "2CUUD"D"DD"D"DUUUUD"D"DD"D"DUU0@@00@@033DDDD3333DDDD33!00@$B@$B00!!00@$B@$B00!333333DDDD333333333333DDDD333333A@D0CD@D@D@D4@D@A@D0CD@D@D@D4@D@UDD"D3"DD"DD"DD"3D"DDUUDD"D3"DD"DD"DD"3D"DDU0#@0C4 @@ 0C4@ 20#@0C4 @@ 0C4@ 23U"DD33""DDDD""33DD"U33U"DD33""DDDD""33DD"U3!B$!B$A$BTE$B$B@$B$BTE$B!B$!B$!B$!B$A$BTE$B$B@$B$BTE$B!B$!B$3333U33DD33U33333333U33DD33U3333A4000#R00@D@D00P%2000CA4000#R00@D@D00P%2000CU333333UU3333D"DD"D3333UU333333UU333333UU3333D"DD"D3333UU333333U@  0@@@@0  @@  0@@@@0  @DD""""33DDDDDDDD33""""DDDD""""33DDDDDDDD33""""DD!A$B B$"B$0!BD$B@$BD$0 B$"B$@$B!!A$B B$"B$0!BD$B@$BD$0 B$"B$@$B!33UD"D"333"DD"333"D"DU3333UD"D"333"DD"333"D"DU33A R@D "@D R@D4#"@D@D "2CDP%@D "@DP%@A R@D "@D R@D4#"@D@D "2CDP%@D "@DP%@UD"UD"D"D"D"D"UD"UD"D"DD"D"DU"DU"D"D"D"D"DU"DUUD"UD"D"D"D"D"UD"UD"D"DD"D"DU"DU"D"D"D"D"DU"DU0000000 00000000000000 000000033333333333333""3333333333333333333333333333""33333333333333!B000 B$000@$!B000 B$000@$3D333333""333333D33D333333""333333D3A4CD000000#" "200000@D4CA4CD000000#" "200000@D4CU"D33333333333UD""DU33333333333D"UU"D33333333333UD""DU33333333333D"U 2@00000 2@0#00000@0# 2@00000 2@0#00000@0#"U3DD3333333333"U3DD3U"3333333333DD3U""U3DD3333333333"U3DD3U"3333333333DD3U"!!!!000000000#!!!!200000000!!!!!!!!000000000#!!!!200000000!!!!3333333333333333333333333U33333333U33333333333333333333333333333333333333333333333333U33333333U3333333333333333333333333A@D " "@D@A@D " "@D@UDD"D"D""D"D"DDUUDD"D"D""D"D"DDU0C@@    @@@40C@@    @@@4Ü-- title: Pascals Triangle -- author: Marioio -- desc: Visual representation of Pascal's Triangle, inspired by Deckard's video on Youtube. -- site: https://marioio333.neocities.org/ -- license: MIT License (change this to your license of choice) -- version: 1.0 -- script: lua colors = 2 squares = {} WIDTH = 130 HEIGHT = 136/2 function BOOT() -- Initialize array for y=1, HEIGHT do squares[y] = {} for x=1,WIDTH do squares[y][x] = 0 end end squares[1][61] = 1 updateTriangle() colors = 3 end function TIC() INPUT() DRAW() end function INPUT() if btnp(0) or btnp(3) or btnp(4) then colors = math.min(16, colors+1) end if btnp(1) or btnp(2) or btnp(5) then colors = math.max(1, colors-1) end end -- INPUT function DRAW() cls(0) print(colors.." Colors", 10,10,colors-1) for y=1,#squares do for x=1, #squares[1] do draw_y = y*2 draw_x = x*2-y if y%2 == 0 then --draw_x = draw_x + 1 end if squares[y][x]>0 then rect(draw_x, draw_y,2,2,squares[y][x]%colors) end end end end -- DRAW function updateTriangle() for y=2, #squares do for x=2,#squares[1]-1 do local left = squares[y-1][x-1] local right = squares[y-1][x] squares[y][x] = left + right end end end