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 [ | |
Description: {Replace several items in one run + example conversions} | |
Date: 27-Mar-2020 | |
Author: "Toomas Vooglaid" | |
] | |
context [ | |
sp: charset " ^-" | |
sp*: [any sp] | |
digit: charset "0123456789" | |
integer: [some digit] |
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 [ | |
Date: 28-Feb-2020 | |
Description: "Another color-picker with named Red-colors and Web-colors" | |
Licence: "Public domain" | |
File: %named-color-picker.red | |
Idea: https://gitter.im/red/red/gui-branch?at=5e58287f4eb23e6ae179f475 | |
] | |
context [ | |
red-colors: split replace/all lowercase trim help-string tuple! [some [#" " | #"^/"]] #" " #" " | |
remove back tail red-colors |
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 [ | |
Description: "Exercise in limited unit handling" | |
Date: 22-Nov-2019 | |
Author: "Toomas Vooglaid" | |
Licence: "Public domain" | |
] | |
context [ | |
digit: charset "0123456789." | |
num: [some digit] | |
unit: ["$/m2" | #"$" | "m2"] |
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 [ | |
Description: "Form number to given precision" | |
Date: 2019-0-13 | |
] | |
form-to: func [ | |
"Form number to a given floating-point precision" | |
number [number!] "Number to be formed" | |
precision [integer!] "Decimal places (positive integer)" | |
/local pcnt? | |
][ |
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 [ | |
Description: "Drop-down autoselect" | |
] | |
blk: [ | |
["Blog" http://www.red-lang.org] | |
["About" https://www.red-lang.org/p/about.html] | |
["Getting Started" https://www.red-lang.org/p/getting-started.html] | |
["Download" https://www.red-lang.org/p/download.html] | |
["Documents" https://www.red-lang.org/p/documentation.html] | |
["Contributions" https://www.red-lang.org/p/contributions.html] |
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 [ | |
Description: {Some quaternion manipulation funcs} | |
Date: 21-Sep-2019 | |
Author: "Toomas Vooglaid" | |
] | |
quaternion: context [ | |
quaternion!: make typeset! [block! hash! vector!] | |
e-pow: function [q][ | |
sc: x: y: z: none | |
set [sc x y z] q |
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: {Update checker} | |
Purpose: {Check for update to Red executable} | |
Author: "Rudolf W. MEIJER" | |
File: %check-update.red | |
Rights: "Copyright (c) 2019 Rudolf W. MEIJER" | |
Language: 'English | |
Tabs: 4 | |
] |
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 [ | |
Date: 16-Aug-2019 | |
See: {[August 15, 2019 9:56 PM](https://gitter.im/red/red?at=5d55aacd4e17537f5239de0c) forward} | |
Description: {Combined from @grggirwin's and @dockimbel's with some spice} | |
] | |
gen-hack2: function [ | |
{Generates randomly suffled copy of the argument and the seed to get it stright} | |
secret [any-string! any-block! binary!] | |
][ | |
random/seed stats |
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: { | |
Red generator for encoded messaged as in: | |
http://www.rebol.com/oneliners.html#section-17 | |
} | |
] | |
gen-hack: function [secret [string!]][ | |
;-- First build a list of integers from 1 to the last index of the secret string | |
table: collect [repeat i len: length? secret [keep i]] |