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 [ | |
filename: %maskinput.red | |
date: "4-Nov-2016" | |
Needs: 'View | |
] | |
star-replace: func [ | |
num | |
/local stars | |
][ |
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
;do %/c/../tabtest.red ;-- Everything before the Red header is not a comment!! | |
Red [ | |
file: %tabtest.red | |
] | |
window-actors: object [ ;-- actors for the window | |
on-key: func [face [object!] event [event!]][ | |
case [ | |
event/key = #"^-" [ | |
print "TAB key caught by window face!" |
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: "JSON parser" | |
File: %json.red | |
Author: "Nenad Rakocevic" | |
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt" | |
] | |
json: context [ | |
quoted-char: charset {"\/bfnrt} | |
exponent: charset "eE" |
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 50 [keep/only collect [repeat j 50 [keep random true]]]] | |
scratchgrid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep false]]]] | |
a: copy grid/1 | |
b: copy grid/50 |
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
; A number of languages have `take-while/drop-while` funcs. This is just to show how you | |
; can build them in Red. | |
; This model can be applied to any function that has a `/part` refinement, or extended in | |
; any number of ways. We don't yet have a standard `apply` or `refine` function in Red. | |
; Once we do, a more general HOF version could take the action as an arg, as well as the | |
; test to apply. | |
; Should this return the position, like FIND, rather than an integer? | |
; No match would then mean a NONE result. REMOVE/TAKE/COPY with /PART |
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 [ | |
Title: "Red compiler and Runner" | |
File: %redcompiler.r | |
Date: 04-Dec-2012 | |
Author: ["Arnold van Hofwegen"] | |
Purpose: "GUI to help with compile and run your Red(/System) scripts." | |
Comment: { | |
29-Nov-2012 Mods and comments by Gregg Irwin. | |
04-Dec-2012 Added check for red.r in the directory | |
Added --red-only compile option |
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: "Sparks demo" | |
Author: "Qingtian Xie" | |
File: %sparks.red | |
Tabs: 4 | |
Needs: View | |
] | |
system/view/auto-sync?: no |
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: "Planet orbits a star" | |
file: %one-planet.red | |
Author: "Arnold van Hofwegen" | |
needs: view | |
] | |
cycle: make block! 361 | |
repeat i 360 [append cycle i] | |
append cycle 1 |
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: ["Martin Ceronio" "Nenad Rakocevic" "Arnold van Hofwegen"] | |
Needs: 'View | |
] | |
system/view/auto-sync?: no | |
break-loop: false | |
i: make image! 50x50 |