Skip to content

Instantly share code, notes, and snippets.

View dockimbel's full-sized avatar

Nenad Rakocevic dockimbel

View GitHub Profile
@dockimbel
dockimbel / resize-image.red
Created June 20, 2016 05:09 — forked from greggirwin/resize-image.red
Red interactive image resizing demo
Red [
Title: "Draw Image Resizing Test"
Author: [REBOL version "Carl Sassenrath" Red port "Gregg Irwin"]
Version: 0.0.1
Needs: View
]
distance: func [pos [pair!]][square-root add pos/x ** 2 pos/y ** 2]
grab-size: 5
@dockimbel
dockimbel / view-hanoi.red
Created June 27, 2016 01:56 — forked from greggirwin/view-hanoi.red
Graphical Red Towers of Hanoi
Red [
File: %view-hanoi.red
Author: "Gregg Irwin"
Date: "4-Oct-2001 — 26-Jun-2016"
Needs: View
]
num-disks: 11 ; Have to set this here until it gets into the UI.
disk-height: 15
disk-cell-width: 20 ; Smallest disk is 1 cell wide
@dockimbel
dockimbel / vector-balls.red
Created June 28, 2016 04:01 — forked from greggirwin/vector-balls.red
Red Vector Balls
Red [
Title: "Vector Balls Demo"
Author: ["Nenad Rakocevic" "Gregg Irwin"]
Date: "[2-feb-2001 15-jun-2016]"
File: %vector-balls.red
Version: 0.4
History: {[
0.2 12-jun-2000 "First version released."
0.3 02-feb-2001 "Speed field added"
0.4 26-jun-2016 "Ported to Red by Gregg"
Red [
Title: "Bouncing Boxes Connected"
Needs: View
]
Arial: make font! [size: 14 name: "Consolas" style: 'bold]
view [
title "Bouncing Boxes Connected"
size 400x400
Red []
find-until: function [series test][
res: copy []
forall series [
either not test first series [
append res first series
] [
break/return res
]
@dockimbel
dockimbel / lc.r
Created August 6, 2016 11:11 — forked from maximvl/lc.r
List comprehension dialect for Rebol
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 []
]
@dockimbel
dockimbel / Livecode enhanced
Created September 10, 2016 06:05 — forked from DideC/Livecode enhanced
Based on Dockimbel VID livecode, this is a little more advanced version where you can define Red's values used by the VID code. And the window is resizable.
Red [
Title: "Simple GUI livecoding demo"
Author: "Nenad Rakocevic / Didier Cadieu"
File: %livecode2.red
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.
}
Red [
Title: "Conway's Game of Life"
Needs: 'View
]
grid: collect [repeat i 10 [keep/only collect [repeat j 10 [keep random true]]]]
scratchgrid: collect [repeat i 10 [keep/only collect [repeat j 10 [keep false]]]]
a: copy grid/1
b: copy grid/10
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)
]
@dockimbel
dockimbel / bmr-calc.red
Created October 30, 2016 04:48 — forked from greggirwin/bmr-calc.red
Reactive BMR calculator in Red
Red [
Title: "BMR (Basal Metabolic Rate) Calculator"
Author: "Gregg Irwin"
File: %bmr-calc.red
Needs: View
Comment: {
An experiment in reactivity and data modeling.
145 lines with blanks and comments removed.