How to Draw a Chessboard in LOGO?

3년 전

@turtlegraphics aims to provide a set of simple-to-follow-and-fun-to-learn examples for Logo Programming, which is known as Turtle Graphics for both parents and kids!.

Logo Programming Source

TO FK :B
  HT # hide the turtle
  IF :B>15 [STOP]
  REPEAT 4 [FD :B RT 90]
  FK :B+1 # draw a bigger square to fill
END

TO QP :Y
  IF :Y>4 [STOP]
  REPEAT 4 [FK 15 FD 15 FK 1 FD 15]
  RT 90 FD 30 RT 90
  REPEAT 4 [FK 15 FD 15 FK 1 FD 15]
  RT 180
  QP :Y+1
END

QP 1

Procedure FK draws a solid square by recursively drawing a smaller square in it. The Chessboard is then drawn by recursively drawing interleaving squares.

Screenshot

image.png

Logo Software

https://chrome.google.com/webstore/detail/logo-turtle/dcoeaobaokbccdcnadncifmconllpihp

If you like this idea and update...

@turtlegraphics and the LogoTurtle is maintained by @justyy

Support him and his work as a witness by

  1. voting him here, or
  2. voting him as a proxy

Some of his contributions: SteemIt Tools, Bots, APIs and Tutorial Thank you!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT
Sort Order:  trending

Me gusta mucho el ajedrez y un entusiasta de la programación. Se conjugan muy bien. Ahora estoy aprendiendo Pyton en un futuro haré proyectos de ajedrez. Saludos @turtlegraphics