I made a thing and I don't know what it's called

in #geometry7 years ago

https://repl.it/@guymichaely/grid-intersections
https://imgur.com/a/iSH3W

I made a little grid drawing algorithm. The way it works is that every time the cursor intersects a line, it changes its direction 90 degrees left or right (whichever one keeps it in the rectangle) and toggles whether or not it draws while it moves. The cursor always starts off in the bottom left and starts off with drawing set to true.

You can change the dimensions of the box on lines 12 and 13, and you can change the drawing speed on line 14 (0 for fast as possible, integers 1 to 10 for slow to fast). On line 15 you can make the cursor disappear by removing the # at the beginning of the line.

Sort:  

Congratulations, you were selected for a random upvote! Follow @resteemy and upvote this post to increase your chance of being upvoted again!
Read more about @resteemy here.

Congratulations @workless! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Congratulations @workless! You received a personal award!

1 Year on Steemit

Click here to view your Board

Do not miss the last post from @steemitboard:

Christmas Challenge - The party continues
Christmas Challenge - Send a gift to to your friends

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @workless! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!