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
\* Copyright (c) 2013, Willi Riha | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright | |
notice, this list of conditions and the following disclaimer in the |
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: "Untitled" | |
Author: "Maxim Velesyuk" | |
Version: 0.0.1 | |
] | |
to-getword: func [w] [ load append copy ":" w ] | |
to-setword: func [w] [ to set-word! append copy "" w] | |
parse-spec: func [spec] [ |
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 [ | |
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
; It might seem like just a party trick, out of context. The goal is not "look how | |
; we can twist the language around!". Think, instead, of how you can use the language | |
; to most clearly express intent in different domains, or for different users. Quite | |
; often, when a user wants a different way to express things, we can accommodate them. | |
; It's also true that we can suggest a form that exists natively in Red, and they will | |
; be just as happy. | |
; | |
; Don't twist the language because you can. But don't be afraid to when it helps. | |
``` |
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 [ | |
Title: "fry.red" | |
Author: ["Gregg Irwin" "Steeve"] | |
File: %fry.red | |
Purpose: { | |
Factor style fry combinators in Red | |
http://docs.factorcode.org/content/article-fry.html | |
works somewhat like a reverse collect/keep | |
} | |
] |
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 [] | |
] |
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: "trig-lab.red" | |
Author: "Gregg Irwin" | |
File: %trig-lab.red | |
Needs: 'View | |
Purpose: { | |
See %math-lab comments for details. This script focuses | |
on trigonometric functions. | |
} | |
] |
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 [ | |
File: %greggs-mezz.red | |
Author: "Gregg Irwin" | |
Purpose: "An interim mezzanine dump, while Red is still moving fast." | |
Tabs: 4 | |
Comment: { | |
Not everything here has been well-tested or, well, tested. Most | |
of the functions are ports from R2, with many more to come. I'm | |
combining everything in one file for ease of experimentation, so | |
you don't have to worry about includes or dependencies with the |