구글 클래스룸
GeoGebra지오지브라 클래스룸

Random labyrinths

Click Redraw to change the pattern.
For details go to https://10print.org/

Script I

#maze"+(i)+"_{"+(j)+"} num=20 width=400 height=400 #Execute(Sequence( , i, 0, num-1)) #Execute(Flatten(Sequence( Sequence( ,j, 0, num-1), i, 0, num-1))) Execute(Sequence( "posX"+(i)+"=width/num*"+(i)+"", i, 0, num-1)) Execute(Sequence( "posY"+(i)+"=height/num*"+(i)+"", i, 0, num-1)) Execute(Flatten(Sequence( Sequence( "toggle"+(i)+"_{"+(j)+"}=RandomBetween( 0, 2 )", j, 0, num-1), i, 0, num-1))) #Segment((posX"+(i)+", posY"+(j)+"), (posX"+(i)+"+width/num, posY"+(j)+"+height/num)) #Segment((posX"+(i)+", posY"+(j)+"+width/num), (posX"+(i)+"+height/num, posY"+(j)+")) Execute(Flatten(Sequence( Sequence( "maze"+(i)+"_{"+(j)+"}=If( toggle"+(i)+"_{"+(j)+"}==0, Segment((posX"+(i)+", posY"+(j)+"), (posX"+(i)+"+width/num, posY"+(j)+"+height/num)), Segment((posX"+(i)+", posY"+(j)+"+width/num), (posX"+(i)+"+height/num, posY"+(j)+")))",j, 0, num-1), i, 0, num-1))) Execute(Flatten(Sequence( Sequence( "ShowLabel( maze"+(i)+"_{"+(j)+"}, false)",j, 0, num-1), i, 0, num-1))) Execute(Flatten(Sequence( Sequence( "If( toggle"+(i)+"_{"+(j)+"}==0, SetColor( maze"+(i)+"_{"+(j)+"}, BLUEVIOLET), SetColor( maze"+(i)+"_{"+(j)+"} , RED))",j, 0, num-1), i, 0, num-1))) Execute(Flatten(Sequence( Sequence( "SetLineThickness( maze"+(i)+"_{"+(j)+"}, 6)",j, 0, num-1), i, 0, num-1)))