Skip to content

Instantly share code, notes, and snippets.

View dockimbel's full-sized avatar

Nenad Rakocevic dockimbel

View GitHub Profile
Red []
find-until: function [series test][
res: copy []
forall series [
either not test first series [
append res first series
] [
break/return res
]
Red [
Title: "Bouncing Boxes Connected"
Needs: View
]
Arial: make font! [size: 14 name: "Consolas" style: 'bold]
view [
title "Bouncing Boxes Connected"
size 400x400
@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"
@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 / 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 / fill-pen-lab.red
Created June 18, 2016 03:02 — forked from greggirwin/fill-pen-lab.red
Fill-pen Lab for Red
Red [
Title: "Fill-pen Lab"
Author: "Gregg Irwin"
File: %fill-pen-lab.red
Needs: View
]
to-color: function [r g b][
color: 0.0.0
if r [color/1: to integer! 256 * r]
@dockimbel
dockimbel / paint.red
Last active June 18, 2016 02:49 — forked from greggirwin/paint.red
Red Paint (World's smallest paint program)
Red [
title: "Paint"
Author: [REBOL version "Frank Sievertsen" Red port "Gregg Irwin"]
File: %paint.red
Tabs: 4
Needs: View
version: 0.0.1
]
draw-blk: copy []
@dockimbel
dockimbel / bubbles.red
Created June 17, 2016 03:36 — forked from greggirwin/bubbles.red
Animated bubbles
Red [
Title: "Bubbles"
Author: [REBOL version "Gabriele Santilli" Red port "Gregg Irwin"]
File: %bubbles.red
Tabs: 4
Needs: View
]
system/view/auto-sync?: no
@dockimbel
dockimbel / analog-clock.red
Last active June 15, 2016 03:29 — forked from greggirwin/analog-clock.red
An analog clock for Red
Red [
Title: "Red O'clock"
Author: "Gregg Irwin"
]
degree-to-xy: func [rad "radius" deg "degrees"] [
as-pair (rad * sine deg) (rad * negate cosine deg)
]
sex-to-degree: func ["Sexagesimal to degrees" n] [n * 6]
Red [needs: view]
turtle: #()
win: layout [ tfield: base 500x500 white draw []
panel [
history: text-list 180x350 data [] return
panel [ button "Save" [save request-file history/data]
button "Load" [commands: load request-file foreach cmd commands [process-cmd cmd]] ]
]