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 [ | |
Title: "Red O'clock" | |
Author: "Gregg Irwin" | |
] | |
degree-to-xy: func [rad "radius" deg "degrees"] [ | |
as-pair (rad * sine deg) (rad * negate cosine deg) | |
] | |
sex-to-degree: func ["Sexagesimal to degrees" n] [n * 6] |
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 [needs: view] | |
turtle: #() | |
win: layout [ panel [ | |
tfield: base 500x500 white draw [] | |
origin tfield/offset tlayer: base 500x500 255.255.255.255 draw [] ] | |
panel [ | |
text "History" return history: text-list 200x350 data [] return | |
panel [ button "Save" [save request-file history/data] |
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
divisible?: func [a b] [0 = remainder a b] | |
; This doesn't work like R3 in how negative widths work. | |
forskip: func [ | |
"Evaluates a block at regular intervals in a series." | |
'word [word!] "Word referring to the series to traverse (modified)" | |
width [integer!] "Interval size (width of each skip)" | |
body [block!] "Body to evaluate at each position" | |
/local orig result op | |
][ |
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 [needs: view] | |
turtle: #() | |
win: layout [ tfield: base 500x500 white draw [] | |
panel [ | |
text "History" return history: text-list 180x350 data [] return | |
panel [ button "Save" [save request-file history/data] | |
button "Load" [commands: load request-file foreach cmd commands [process-cmd cmd]] ] | |
] |
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
ralette-grammar: [ | |
collect any [ | |
['decompose [ | |
'rgb keep ([ | |
r: (color/1) / 255.0 | |
g: (color/2) / 255.0 | |
b: (color/3) / 255.0 | |
]) | | |
'hsl keep ([ | |
h: (color/1) / 255.0 |
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 [ | |
Title: "Red GUI tour" | |
Purpose: {To showcase the current capabilities of Red GUI} | |
Author: "Rudolf W. MEIJER" | |
Version: 0.9.0 | |
Date: "12-Dec-2015" | |
Needs: 'view | |
Rights: "Copyright (c) 2015 Rudolf W. MEIJER" | |
] |
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 [ | |
Title: "Sintezar PM-102 - Phase Manipulation Digital Sintesizer" | |
Name: 'PM-102 | |
Version: 0.4.0 | |
Needs: 'View | |
; Date: 25-11-2015 | |
File: %pm-102.red | |
Author: "Boleslav Březovský" | |
; Email: [email protected] | |
] |
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 [] | |
random/seed 1337 | |
; produces a series of chromosomes within [0, dna] of each supplied maximum | |
make-dna-strand: func[dna | |
/local dna-length result][ | |
dna-length: length? dna | |
result: make block! dna-length | |
foreach chromosome dna [ |
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 [ | |
Title: "Tile game" | |
Purpose: {An implementation in Red of the 4x4 sliding tile puzzle} | |
Author: "Rudolf W. MEIJER (meijeru)" | |
File: %tile-game.red | |
Needs: 'View | |
Usage: { | |
Click on any tile that is adjacent to the empty space | |
and it will shift to that space. | |
Try to obtain a given configuration, e.g. 1 to 15 in order. |
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 [] | |
forth: context [ | |
prog: [1 2 3 4 5 6 7 8 '+ '+ '* 150 '+ '* '+ '* '*] | |
registers: ['eax 'ebx 'ecx 'edx] | |
register-taint: [] ; registers we've touched in this set | |
register-goop: [] ; registers we need to pop to use | |
register-sets: 0 | |
next-register: head registers |