Last active
July 12, 2019 16:05
-
-
Save dockimbel/2d95c8c85e5bfed71bd1c15294ee77c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Author: ["Didier Cadieu" "Nenad Rakocevic"] | |
File: %worm.red | |
Needs: 'View | |
] | |
win: layout [ | |
size 400x500 | |
across | |
style ball: base 30x30 transparent draw [fill-pen blue circle 15x15 14] | |
ball ball ball ball ball ball ball ball return | |
ball ball ball ball ball ball ball ball return | |
ball ball ball ball ball ball ball ball return | |
b: ball loose | |
do [b/draw/2: red] | |
] | |
follow: function [left right][ | |
if pair? o: left/extra [left/offset: left/offset + o / 2] | |
left/extra: right/offset | |
] | |
faces: win/pane | |
while [not tail? next faces][ | |
react/link/later :follow [faces/1 faces/2] ;-- construct a chain of reactions linking all balls, two by two. | |
faces: next faces | |
] | |
view win |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment