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: %livecode.red | |
Version: 1.2.1 | |
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
Red [ | |
Purpose: "Arabic to Roman numbers converter" | |
Date: "06-Oct-2016" | |
] | |
table: [1000 M 900 CM 500 D 400 CD 100 C 90 XC 50 L 40 XL 10 X 9 IX 5 V 4 IV 1 I] | |
to-Roman: function [n [integer!]] reduce [ | |
'case collect [ | |
foreach [a r] table [ |
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 [ | |
Purpose: "Arabic <-> Roman numbers converter" | |
Author: "Didier Cadieu" | |
Date: "07-Oct-2016" | |
] | |
; Lookup tables for conversion | |
table-r2a: reverse copy table-a2r: [1000 "M" 900 "CM" 500 "D" 400 "CD" 100 "C" 90 "XC" 50 "L" 40 "XL" 10 "X" 9 "IX" 5 "V" 4 "IV" 1 "I"] | |
roman-to-arabic: func [r [string!] /local a b e] [ |
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: "Test of `find-window and `focus funcs" | |
author: "Didier Cadieu" | |
] | |
find-window: func [ | |
"Find a face's window face." | |
face [object!] | |
][ | |
while [face/parent] [face: face/parent] |
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: "Maxim Velesyuk" | |
description: "Common Lisp condition-restart system implementation for Red" | |
] | |
; utils | |
*word-counter*: 0 | |
gen-word: does [ | |
*word-counter*: *word-counter* + 1 | |
to-word append "G-" to-string *word-counter* |
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: "Maxim Velesyuk" | |
description: "Dynamic variables implementation for Red" | |
] | |
; utils | |
forskip: func ['series skipn body /local s] [ | |
s: get series | |
while [ not tail? s ] [ | |
do body |
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: "Gregg Irwin" | |
File: "%fill.red" | |
Source: "Gitter @greggirwin " | |
Reference: ":point_up: [May 4, 2017 6:50 PM](https://gitter.im/red/red/welcome?at=590b4daac93941e153c94b8e)" | |
Changed-by: "Toomas Vooglaid" | |
Changed-date: "2017-05-05" | |
Change: "Added 'justify and helper 'x'" | |
] | |
x: make op! func [n c][pad/with copy "" n to char! c] |
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: "Toomas Vooglaid" | |
Date: "2017-05-07" | |
Changed: "2018-07-09" | |
Purpose: "Print a directory tree" | |
File: "%dir-tree.red" | |
] | |
context [ | |
; Some helpers | |
get-char: func [hex][to-char to-integer hex] |
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 [] | |
#if config/OS <> 'Windows [ | |
colors: [black red green yellow blue magenta cyan white] | |
;https://en.wikipedia.org/wiki/ANSI_escape_code | |
color: function [s f /bg b /space][ | |
o: clear {} | |
s: form s | |
if space [s: rejoin [{ } 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 [ | |
Needs: 'View | |
] | |
; #include %support/call.red | |
print "clr - define object" | |
celer: object [ |
OlderNewer