This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 2017-10-23 | |
] | |
context [ | |
A: B: C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z: none | |
numbers: make block! 10 | |
nums: make block! 10 | |
out: make block! 10 | |
letters: make block! 10 |
This file contains hidden or 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
; proof of concept (but usable!) implementation of immutable persistent 'blocks' in Red | |
; author: Jay G. Porcasi (@numberjay) | |
; the exported API is at the bottom, starting with: set '<function name> ... | |
; free to use without any warranty of any kind: use at your own leisure and risk | |
; for bugs, suggestions, questions... comment here below or reach me on Gitter (@numberjay) | |
; copyright Jay G. Porcasi 2017 | |
context [ | |
; all functions ending with ' are helper functions working on 'immutable' blocks only |
This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 26-11-2017 | |
] | |
range: function [val1 val2 /step stp /limit /enbase ebase /debase dbase /unicode][ | |
stp+?: none | |
stp: any [stp either any [percent? val1 percent? val2] [1%][1]] | |
if any [all [block? stp zero? stp/3] zero? stp] [return none] | |
case [ | |
debase [ |
This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 27-11-2017 | |
] | |
lazy-range: function [ | |
"Returns function that generates next value in (possibly infinite) range" | |
val [scalar!] "Initial value" | |
/step stp [scalar! block!] "By which to increment each next value" | |
/limit lim [integer!] "How many new values to generate" | |
/stop stopval [scalar! block!] "On which value to stop generation of new values; if block, then also after how may matches" |
This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 27-11-2017 | |
] | |
context [ | |
tmp: x: none | |
ord: func [val /local v][ | |
rejoin [ | |
v: to-string val | |
either find [11 12 13] val ["th"][ |
This file contains hidden or 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 / Mike Yaunish" | |
File: %livecode-enhanced.red | |
Version: 1.3.0 | |
Needs: 'View | |
Usage: { | |
Type VID code in the bottom left area, you will see the resulting GUI components | |
rendered live on the right side and fully functional (events/actors/reactors working live). | |
The top left area lets you define Red's values to be used in your VID code, even functions or anything. |
This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 2017-12-12 | |
] | |
set 'ring function [ser [series!]][ | |
context [ | |
series: ser | |
circle: function [/at aval /skip sval /next /back /part pval][ | |
case/all [ | |
at [ |
This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 2017-12-16 | |
Needs: %range.red | |
Needs-Gist: https://gist.github.com/toomasv/0e3244375afbedce89b3719c8be7eac0 | |
] | |
do %range.red | |
context [ | |
md: make font! [name: "Consolas" size: 12 color: black] | |
ft: make font! [name: "Tahoma" size: 36 color: black];;Lucida Sans Unicode;Unifont;EversonMono |
This file contains hidden or 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 | |
] | |
b-or-w?: func [color [tuple!] /local darkness [float!]] [ | |
darkness: 1 - (((0.299 * color/1) + (0.587 * color/2) + (0.114 * color/3)) / 255) | |
either (darkness < 0.5) [return black][return white] | |
] | |
size: 100x25 |
This file contains hidden or 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: "Toomas Vooglaid" | |
Date: 2017-12-31 | |
History: [ | |
2017-12-28 {First draft} | |
2018-01-20 {Added arrows, subtree moving, elementary interactive editing} | |
2018-01-24 {Edges formatting} | |
2018-02-01 {Added differnt edge-ends, layout orientations, improved options-handling} | |
2018-02-03 {Implemented stepped (orthogonal) edges, improved star layout} | |
2018-02-06 {Added directions `across` (default: perpendicular to the step-away direction) and `away` (in the step-away direction). |