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
http://news.e-scribe.com/193 | |
To move, you tell the computer how many numbers (counting from the left) to reverse. | |
For example, if the current list is 2 3 4 5 1 6 7 8 9 and you reverse 4, | |
the result will be 5 4 3 2 1 6 7 8 9. Now if you reverse 5, you win. | |
• Comment from Pascal | |
Funny game, here is a REBOL version of this game. An interesting thing is its readability. | |
numbers: random ordered: [1 2 3 4 5 6 7 8 9] |
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: "Example of definitional scoping" | |
Date: 20-Mar-2017 | |
Author: https://github.com/9214 | |
File: %(s)puny-mortals.red | |
] | |
meditate: function ['on thing] [ | |
print "ॐ" |
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: "Word finder" | |
Purpose: {Find occurrences of words in the source files | |
of the Red toolchain and display them} | |
Author: "Rudolf W. MEIJER" | |
File: %word-finder.red | |
Needs: 'View | |
Rights: "Copyright (c) 2019 Rudolf W. MEIJER" | |
History: [ | |
[0.0 23-Jan-2019 {Start of project}] |
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: "PoC script for checking if brackets/parens are matching in a Red file" | |
] | |
check-brackets: function [file [file!]][ | |
line: 1 | |
stack: clear [] | |
skip-chars: complement charset "[]()^/" | |
parse read file [ |
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 [ | |
name: 'inject | |
file: %inject.red | |
author: "Gregg Irwin" | |
notes: { | |
Red version of Ladislav Mecir's R2 `build` func. I can't find his on | |
the net, to link to, but can post his original if desired. His point | |
was that `compose` isn't always easy to use, when parens are part of | |
block you're composing, or how your blocks are structured, whether you | |
can use `/only` with `compose`. e.g. |
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 [] | |
; outright improvement of collect mezzanine's performance and RAM footprint | |
; the compiled default "collect" | |
collect1: :collect | |
; the interpreted default "collect" | |
collect2: func spec-of :collect body-of :collect |
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: "Demo how to serialize/deserialize a face tree on disk" | |
] | |
mold-face: function [root [object!] return: [string!]][ | |
foreach-face root [ | |
face/parent: none face/state: none | |
if font: face/font [font/parent: none font/state: none] | |
if para: face/para [para/parent: none] | |
] |
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: "Animation system for VID" | |
Needs: 'View | |
Notes: { | |
Simplyfied Ease in/out formulas : http://gizma.com/easing/#l | |
See at the end of page source for javascripts formulas (included elastic) : http://easings.net/en | |
} | |
] |
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[] | |
dispatcher: func [ | |
"Return dispatcher function that can be extended with DISPATCH" | |
spec [block!] "Function specification" | |
][ | |
func spec [ | |
case [] | |
] | |
] |
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: "Where" | |
Purpose: "Find where function is defined" | |
Author: "Boleslav Březovský" | |
] | |
where: function [ | |
"Return file where function is defined or NONE, if the definition can't be found" | |
'name | |
/in |
NewerOlder