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: "luce80" | |
Licence: 'PD | |
] | |
; from https://en.wikipedia.org/wiki/Julian_day | |
julian-day-number: func [day month year /local a y m] [ ; in Red 0.6.2, integer calcs give integer result so we could remove to-integer(s) | |
; TBD check params | |
a: to-integer 14 - month / 12 | |
y: year + 4800 - a |
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
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. |
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 [] | |
inc-value: func [ | |
face | |
color-id | |
dest-face | |
/local value rate | |
] [ | |
unless face/extra [face/font/color: 255.255.255] | |
overflow?: false |
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: "Toomas Vooglaid" | |
file: "%regex.red" | |
Purpose: {Regex to parse converter} | |
History: {Started: 2017-05-09 | |
v.0.1: 2017-05-12 -- first working version with: | |
start `^^` and end `$` anchors, | |
non-capturing groups (one level) with alterns, | |
quantifiers (possessive), | |
some character-classes. |
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 [] | |
#if config/OS <> 'Windows [ | |
colors: [black red green yellow blue magenta cyan white] | |
;https://en.wikipedia.org/wiki/ANSI_escape_code | |
color: function [s f /bg b /space][ | |
o: clear {} | |
s: form s | |
if space [s: rejoin [{ } s { }]] |
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: {Maxim Velesyuk} | |
description: {draw dialect playground} | |
] | |
demo: trim { | |
fill-pen gray | |
box 0x0 400x400 | |
do [c: to-tuple reduce [ | |
random 255 random 255 random 255] |
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: {simple game} | |
author: {Maxim Velesyuk} | |
version: 2.2 | |
changelog: { | |
2.2 | |
* added sleep to the loop to reduce CPU load | |
2.1 | |
* added win screen display time |
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: "Maxim Velesyuk" | |
description: "Dynamic variables implementation for Red" | |
] | |
; utils | |
forskip: func ['series skipn body /local s] [ | |
s: get series | |
while [ not tail? s ] [ | |
do body |
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: "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}] |
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: "Maxim Velesyuk" | |
description: "Common Lisp condition-restart system implementation for Red" | |
] | |
; utils | |
*word-counter*: 0 | |
gen-word: does [ | |
*word-counter*: *word-counter* + 1 | |
to-word append "G-" to-string *word-counter* |