Skip to content

Instantly share code, notes, and snippets.

Red [
Title: "Red GUI tour"
Purpose: {To showcase the current capabilities of Red GUI}
Author: "Rudolf W. MEIJER"
Version: 0.9.0
Date: "12-Dec-2015"
Needs: 'view
Rights: "Copyright (c) 2015 Rudolf W. MEIJER"
]
Red [
Title: "Tile game with randomizing"
Purpose: {An implementation in Red of the 4x4 sliding tile puzzle
with random start configuration
}
Author: "Rudolf W. MEIJER (meijeru)"
File: %tile-game-2.red
Needs: 'View
Usage: {
Click Random to obtain initial configuration.
now: func [
"temporary replacement for Rebol-like now function, absent in Red"
/time
/local ts dd mm yy hh mm ss
][
ts: read time-server
yy: to integer! copy/part ts 4
mm: to integer! copy/part at ts 6 2
dd: to integer! copy/part at ts 9 2
hh: to integer! copy/part at ts 12 2
@meijeru
meijeru / %grep.red
Last active January 21, 2017 05:21
Red [
Title: "Partial grep implementation"
Purpose: {To search the input for lines containing a match
to the given pattern, specified as a regular expression}
Author: "Rudolf W. MEIJER"
File: %grep.red
Version: 0.4.0
Date: "24-Nov-2016"
Rights: "(c) Copyright 2016 Rudolf W. MEIJER"
History: [
@meijeru
meijeru / split-url.red
Last active May 8, 2017 21:46
Split a url! value into components
Red [
Title: "URL splitter"
Purpose: {split a url into its compoments}
Author: "Rudolf W. MEIJER"
File: %split-url.red
Version: 0.2.0
Date: "02-Apr-2017"
Rights: "Copyright (c) Rudolf W. MEIJER"
History: [
[0.0.0 "25-Mar-2017" {Start of project}]
@meijeru
meijeru / %docstring-missing.txt
Created May 13, 2017 15:19
Functions with missing docstring
<<
>>
>>>
as-color
as-ipv4
as-rgba
ask
bind
charset
comment
@meijeru
meijeru / arith.txt
Last active September 6, 2017 15:36
Types of artihmetic operations
Updated to Red for Windows version 0.6.2 built 7-Jun-2017/15:13:57+2:00
The table gives type of first operand, type of second operand, result type
for + (add), - (subtract), * (multiply), / (divide), // (modulo) and % (remainder)
For vectors, the element type is distinguished.
There is one case (time with time) where the result type is not the same
for all allowed operations.
After each type combination, the reverse combination is given.
The fourth column gives the operators for which the combination is forbidden.
If the result type is error, the combination is forbidden for all operators.
@meijeru
meijeru / count-code-lines.r
Last active January 23, 2018 12:01
Count the number of lines of code in the Red source files
Rebol []
red-source: %/C/Users/Eigenaar/Projects/Red/sources/ ; adapt this for your situation
output-sources: %sources.txt
version: read red-source/version.r
vdate: modified? red-source/version.r
nl: "^/"
REBOL [
Title: "Red concordance program"
Name: "concordance"
File: %red-concordance.r
Author: "Rudolf W. Meijer"
Rights: "Copyright (C) 2015-2018 Rudolf W. MEIJER. All Rights Reserved"
Needs: [2.7.6]
REBOL [
Title: "Red Lexical Scanner"
Author: "Nenad Rakocevic"
File: %lexer.r
Tabs: 4
Rights: "Copyright (C) 2011-2015 Nenad Rakocevic. All rights reserved."
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt"
Comments: {Adapted by Rudolf W. Meijer for making the Red concordance.
This involves parsing Red, Red/System and REBOL programs by one lexer.
The changes are: