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: "Shooting" | |
Description: "Exercise with parametrized curve" | |
Date: 2019-08-10 | |
Author: "Toomas Vooglaid" | |
Licence: "Public domain" | |
Usage: { | |
To load and orient the weapon - drag point. | |
To relocate the target - drag target. | |
To relocate weapon - ctrl-drag it (cannon relocates horizontally on dragging). |
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 [ | |
Date: 28-July-2019 | |
Notes: {Click on window to add flies} | |
] | |
bb: [] fc: target: none | |
web: load %web.png | |
set-step: func [face][as-pair | |
face/extra/speed * (cosine face/extra/dir) | |
face/extra/speed * (sine face/extra/dir) | |
] |
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: {Ray casting exercise} | |
Needs: View | |
Date: 25-July-2019 | |
Inspiration: https://github.com/krisajenkins/elm-rays | |
Tutorial: https://ncase.me/sight-and-light/ | |
Redporter: "Toomas Vooglaid" | |
Licence: "Public domain" | |
] | |
; To change into plain light instead of radial |
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: {Request a date} | |
Purpose: {To enter a date using a calendar display} | |
Author: "Rudolf W. MEIJER" | |
File: %request-date.red | |
Notes: {Inspired by the corresponding Rebgui facility} | |
Language: 'English | |
Tabs: 4 | |
] ; end prologue |
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: "Yet another color-picker" | |
Date: 9-May-2019 | |
] | |
context [ | |
colors: [] | |
colors2: [pen off translate 260x280 []] | |
i: 9 | |
j: 256 / (i - 1) | |
img: none |
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: "Find pattern" | |
Description: "Searches Red source files for a parse pattern" | |
] | |
allow: func [any][yes] | |
get-files: function [ | |
"recursively collects the full file paths for all the files in the given directory" | |
dir [file!] /filter "only collect files where the predicate evaluates to true" pred [function!] |
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[] | |
dist-to-color: func [dist][ | |
to tuple! reduce [dist * 256 dist * 256 dist * 256] | |
] | |
distance: func [start end /local diff][ | |
diff: end - start | |
absolute square-root diff/x * diff/x + (diff/y * diff/y) | |
] |
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 [] | |
context [ | |
env: self | |
canvas: none | |
tab-pan: drawing-panel-tab: animations: none | |
info-panel: edit-options-panel: options-panel: drawing-panel: figs-panel: anim-panel: none | |
layer: layer1: drawing: selection-layer: grid-layer: drawing-layer: edit-layer: none | |
win: layout/options compose/deep [; | |
title "Drawing pad" | |
size 540x465 |
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
; You will need AutoHotkey.dll for this to work. | |
; It can be downloaded from https://github.com/HotKeyIt/ahkdll (source) | |
; or http://hotkeyit.github.io/v2/ for binaries (v1 on same page) | |
; Only tested with v1 - you will of course need MS Word on your machine. | |
; Use 32-bit AutoHotkey dll only! | |
; If red can't find it in your script directory, please put | |
; the dll in SysWOW64. (By all means try including it in your script | |
; directory first, if you like.) |
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 [ | |
Needs: View | |
Author: "Gregg Irwin" | |
Porter: "Toomas Vooglaid" | |
Source: https://gitter.im/red/red/gui-branch?at=5c7f0f2e86e34a126f92a7be | |
Port-date: 6-Mar-2019 | |
] | |
#system [ | |
#import [ | |
"kernel32.dll" stdcall [ |