Skip to content

Instantly share code, notes, and snippets.

View iArnold's full-sized avatar

iArnold iArnold

  • Freelance ICT Specialist
  • Netherlands
View GitHub Profile
Red [
Title: "Download new Red master zip program"
filename: %red-master-dl.red
author: "Arnold van Hofwegen"
date: "11-May-2016"
Needs: 'View
]
github-page: copy ""
@iArnold
iArnold / string-to-integer.red
Created June 17, 2015 19:10
string-to-integer convertion
string-to-integer: function [
input [string!]
return: [integer! none!]
/local
total [integer!]
in-char [char! string!]
cipher [integer!]
is-number [logic!]
][
is-number: false
@iArnold
iArnold / alert.red
Created April 6, 2016 06:58
Alert window example by Dockimbel
alert: function [
"Displays an alert message"
msg [string!] "Message to display"
][
view/flags [
t: text msg center return
b: button "ok" [unview]
do [b/offset/x: t/offset/x + (t/size/x - b/size/x / 2)]
][modal popup]
]
Red [
Title: "Added title"
filename: %guitest.red
author: "Arnold van Hofwegen"
Icon: default
date: "30-Mar-2016"
Needs: 'View
]
system/view/debug?: no
join: func [
"Concatenates values."
value "Base value"
rest "Value or block of values"
][
value: either series? :value [copy value] [form :value]
repend value :rest
]
Red [ "Reduces and joins a block of values."
]
rejoin: func [
block [block!] "Values to reduce and join"
][
if empty? block: reduce block [return block]
append either series? first block [copy first block] [
form first block
] next block
Red [
filename: %guitest.red
author: "Arnold van Hofwegen"
date: "07-Mrt-2016"
Needs: 'View
]
system/view/debug?: no
live?: system/view/auto-sync?: no
@iArnold
iArnold / tb.red
Last active February 24, 2016 08:06
Test board illustrating drag drop swap to top make images disappear
Red [
"Drag and Drop over other images test in simple GUI"
filename: %tb.red
author: "Arnold van Hofwegen"
version: 0.6.0
date: "18-Dec-2015"
Needs: 'View
]
system/view/debug?: no
Red [
Needs: 'view
]
; Declaring the window
win: make face! [
type: 'window text: "Red Splash screen By Arnold" offset: -500x0 size: 100x200
]
; -- Declare window pane
Windows none build none
[1 [0x8 0x7] 4 [0x5] 11 [0x7 2x7] 13 [0x7 2x7 3x7 4x7 5x7 6x7 1x6 1x5 1x4 1x3 1x
0 1x8] 21 [0x7 4x7] 24 [2x5] 31 [4x8] 41 [4x8] 44 [4x5] 51 [4x8] 61 [4x7 8x7] 64
[6x5] 71 [6x7 8x7] 73 [6x7 5x7 4x7 3x7 2x7 8x7 7x6 7x5 7x4 7x3 7x0 7x8] 81 [8x8
8x7] 2 [8x5]]
Before calculating piece-offset
white-king: make face! [
type: 'base offset:
pair 265x465 4x9 265 465
After calculating piece-offset