Skip to content

Instantly share code, notes, and snippets.

View koba-yu's full-sized avatar

Koba-yu koba-yu

View GitHub Profile
Red [
Title: "Conway's Game of Life"
Needs: 'View
]
system/view/auto-sync?: no
grid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep random true]]]]
scratchgrid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep false]]]]
a: copy grid/1
b: copy grid/50
@DideC
DideC / focus.red
Created October 19, 2016 08:37
Tiny VID utility func and test (find-window, focus)
Red [
title: "Test of `find-window and `focus funcs"
author: "Didier Cadieu"
]
find-window: func [
"Find a face's window face."
face [object!]
][
while [face/parent] [face: face/parent]
@DideC
DideC / heart-animation.red
Last active January 30, 2017 10:37
Heart animation for Red (only). New parameters added to the (reordered) control panel to play with the animation + credits. Nice time eater ;-)
Red [
title: "Heart animation"
author: "Didier Cadieu"
notes: {
Traduction in Red of Terebus Volodymyr javascript demo : http://codepen.io/tvolodimir/pen/wqKuJ
}
Needs: View
]
;*** Settings
@PeterWAWood
PeterWAWood / typing.red
Last active February 12, 2019 20:55
Entering text into Notepad from Red
Red []
#system [
chr: 1
handle: 0
KEYDOWN: 0
KEYUP: 2
minus-one: -1
pointer-to-minus-one: :minus-one
rs-phrase: ""
@rebolek
rebolek / nsource.red
Last active June 19, 2019 20:11
Provides source of Red native functions
Red [
Title: "Nsource - native source"
Purpose: "Print source for native functions"
Author: "Boleslav Březovský"
Date: "8-6-2017"
]
indent: func [
"(Un)indent text by tab"
string [string!] "Text to (un)indent"
@greggirwin
greggirwin / nsource.red
Last active June 13, 2017 05:27 — forked from rebolek/nsource.red
Provides source of Red native functions
Red [
Title: "Nsource - native source"
Purpose: "Print source for native functions"
Author: "Boleslav Březovský"
Date: "8-6-2017"
]
indent: func [
"(Un)indent text by tab"
string [string!] "Text to (un)indent"
@maximvl
maximvl / abc-score.red
Last active September 27, 2017 03:59
abc score for Red code
Red [
author: {Maxim Velesyuk}
usage: {
abc-score? <block of code>
abc-score? %file.red
abc-score? :some-function
}
description: {
The ABC software metric defines an ABC score as a triplet of values that represent the size of a set of source code statements.
An ABC score is calculated by counting the number of assignments (A), number of branches (B), and number of conditionals (C) in a program.
@dander
dander / generators.red
Last active August 27, 2020 07:29
An experiment to make a general purpose generator-creating function
Red [
Title: "generator function experiments"
Author: "Dave Andersen"
Date: 27-Sep-2017
]
reload: does [do system/options/script]
; @JacobGood's closure func
closure1: func [
@mikeyaunish
mikeyaunish / Livecode-enhanced.red
Created December 7, 2017 05:29
Based on Dockimbel and Didier VID livecode. Added saving and loading of files and window configuration. Make VID updates controllable.
Red [
Title: "Simple GUI livecoding demo"
Author: "Nenad Rakocevic / Didier Cadieu / Mike Yaunish"
File: %livecode-enhanced.red
Version: 1.3.0
Needs: 'View
Usage: {
Type VID code in the bottom left area, you will see the resulting GUI components
rendered live on the right side and fully functional (events/actors/reactors working live).
The top left area lets you define Red's values to be used in your VID code, even functions or anything.
@toomasv
toomasv / graph.red
Last active July 11, 2018 02:22
Toy graph DSL
Red [
Author: "Toomas Vooglaid"
Date: 2017-12-31
History: [
2017-12-28 {First draft}
2018-01-20 {Added arrows, subtree moving, elementary interactive editing}
2018-01-24 {Edges formatting}
2018-02-01 {Added differnt edge-ends, layout orientations, improved options-handling}
2018-02-03 {Implemented stepped (orthogonal) edges, improved star layout}
2018-02-06 {Added directions `across` (default: perpendicular to the step-away direction) and `away` (in the step-away direction).