One Liners

- XLogo

xlogo

Copy and paste any one line of code into the XLogo command line and press <Enter> key to run. Widen the XLogo window to easily see and edit a long instruction.

You may need to first type in CS to clear the screen. You can change the default pen and screen color by selecting Tools / Preferences / Options from the XLogo menu.

To slow down the drawing speed add in your own Wait commands.

Try and work out the image each code will produce before you run it...

One Liners
One Liners
  1. Repeat 215 [Forward Repcount Right 70]
  2. Repeat 2 [Repeat 12 [Forward 180 Right 150 ] Right 180]
  3. Repeat 36 [Repeat 36 [Forward 16 Right 10 ] Right 10]
  4. Repeat 6 [Repeat 18 [Forward 140 Right 100 ] Right 60]
  5. Repeat 2 [Repeat 9 [Forward 100 Left 70 Forward 45 Right 150] Left 180]
  6. Back 150 Repeat 30 [Forward 300 Right 156]
  7. Repeat 120 [Forward 3*RepCount Right 90]
  8. Repeat 64 [SetXY (Random 380)-190 (Random 380)-190]
  9. Repeat 20 [Repeat 4 [Forward 120 Right 90] Right 18]
  10. Wrap Repeat 1200 [Forward 20 Right 90*Random 3]
  11. For [I 0 1013] [SetHeading (90-360*(Power :I 3)/1013) Forward 16]
  12. Repeat 4 [Repeat 8 [Repeat 4 [Right 90 Forward 72] Back 72 Left 45] Left 90]
  13. Repeat 80 [Left Ran 360 Forward Ran 160 Left Ran 40 Forward Ran 60 Home]
  14. Repeat 3600 [Forward 10 Right RepCount + 0.2]
  15. Wrap Hideturtle Repeat 10000 [Forward 8 Left (16-Random 32)]
  16. Repeat 20 [Repeat 6 [Forward 80 Right 60] Right 100]
Paste one line of code into the XLogo command line. Press enter to run.

The repeat command repeats code contained in the square brackets a set number of times.
Repcount is a count of the number of times the repeat loop has been executed.