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
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] | |
button "Load" [commands: load request-file foreach cmd commands [process-cmd cmd]] ] | |
return status: text "" 200x25 ] |
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
; We have other reflective functions (words-of, body-of, etc.), but | |
; this is a little higher level, sounded fun to do, and may prove | |
; useful as we write more Red tools. It also shows how to make your | |
; own typesets and use them when parsing. | |
arity-of: function [ | |
"Returns the fixed-part arity of a function spec" | |
spec [any-function! block!] | |
/with refs [refinement! block!] "Count one or more refinements, and add their arity" | |
][ |
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: "ifgem" | |
] | |
#do [ | |
macro: context [ | |
make-object-spec: function [words] [ | |
spec: copy [] |
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: "Heart animation" | |
author: "Didier Cadieu" | |
notes: { | |
Traduction in Red/Rebol of Terebus Volodymyr javascript demo : http://codepen.io/tvolodimir/pen/wqKuJ | |
} | |
Needs: View | |
] | |
;*** Settings |
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 [ | |
description: { | |
Attempt to copy Haiku Editor | |
(http://forthsalon.appspot.com/haiku-editor) | |
} | |
] | |
map: func [s 'word body] [ | |
bind body 'word | |
forall s [ |
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: "BMR (Basal Metabolic Rate) Calculator" | |
Author: "Gregg Irwin" | |
File: %bmr-calc.red | |
Needs: View | |
Comment: { | |
An experiment in reactivity and data modeling. | |
145 lines with blanks and comments removed. | |
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: "Raytracer" | |
Needs: 'View | |
Notes: "Simple raytracer based on 'Ray Tracing in One Weekend' by Peter Shirley" | |
] | |
vec3_dot: function [a[vector!] b[vector!]] [ | |
reduce (a/1 * b/1) + (a/2 * b/2) + (a/3 * b/3) | |
] |
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: "Conway's Game of Life" | |
Needs: 'View | |
] | |
grid: collect [repeat i 10 [keep/only collect [repeat j 10 [keep random true]]]] | |
scratchgrid: collect [repeat i 10 [keep/only collect [repeat j 10 [keep false]]]] | |
a: copy grid/1 | |
b: copy grid/10 |
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: "Simple GUI livecoding demo" | |
Author: "Nenad Rakocevic / Didier Cadieu" | |
File: %livecode2.red | |
Needs: 'View | |
Usage: { | |
Type VID code in the bottom right area, you will see the resulting GUI components | |
rendered live on the left side and fully functional (events/actors/reactors working live). | |
The top right area let you define Red's values to be used in your VID code, even functions or anything. | |
} |
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
REBOL [] | |
print [] | |
lc: function [block] [lc-state lc-rule input-rule filter-rule i e] [ | |
lc-state: make object! [ | |
do-block: copy [] | |
inputs: copy [] | |
filter-block: none | |
input-state: copy [] | |
res: copy [] | |
] |
NewerOlder