This file contains hidden or 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
Rebol [ | |
see: https://www.reddit.com/r/dailyprogrammer/comments/5wnbsi/20170228_challenge_304_easy_little_accountant/ | |
] | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Helper functions | |
tie: function [s delim /string] [ | |
s: next s | |
forskip s 2 [insert s delim] |
This file contains hidden or 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
Rebol [ | |
see: https://www.reddit.com/r/dailyprogrammer/comments/5go843/20161205_challenge_294_easy_rack_management_1/ | |
] | |
scrabble: function [rack word] [ | |
rack: reverse sort copy rack | |
score: 0 | |
score-and-remove: func [s] [ | |
score: score + score-letter s/1 |
This file contains hidden or 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
Rebol [ | |
see: https://www.reddit.com/r/dailyprogrammer/comments/4cb7eh/20160328_challenge_260_easy_garage_door_opener/ | |
] | |
states: [ | |
'CLOSED [click: 'OPENING blocked: '*CLOSED] | |
'OPENING [click: 'STOPPED_WHILE_OPENING complete: 'OPEN blocked: '*OPENING] | |
'OPEN [click: 'CLOSING blocked: 'OPEN_BLOCKED] | |
'CLOSING [click: 'STOPPED_WHILE_CLOSING complete: 'CLOSED blocked: 'EMERGENCY_OPENING] | |
'STOPPED_WHILE_OPENING [click: 'CLOSING blocked: '*STOPPED_WHILE_OPENING] |
This file contains hidden or 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
Rebol [ | |
Title: {Direct port of Norvig's "When is Cheryl's birthday?"} | |
see: http://nbviewer.ipython.org/url/norvig.com/ipython/Cheryl.ipynb | |
version: 1.0.0 ; short & sweet version (no function docs or optional dates) | |
] | |
filter: function [f s] [ | |
collect [foreach n s [if f n [keep n]]] | |
] |
This file contains hidden or 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
Rebol [ | |
see: https://gist.github.com/jorin-vogel/2e43ffa981a97bc17259 | |
version: 0.0.3 | |
] | |
import http://reb4.me/r3/altjson | |
json: load-json https://gist.githubusercontent.com/jorin-vogel/7f19ce95a9a842956358/raw/e319340c2f6 | |
file: to-file format/pad [-4 -2 -2] reduce [now/year now/month now/day ".csv"] 0 | |
csv: open/write file |
This file contains hidden or 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
Rebol [ | |
see: http://codegolf.stackexchange.com/a/34337/11021 | |
] | |
c: complement charset "<>" | |
f: func [s n] [ | |
w: none | |
tag-level: 0 | |
trigger: does [n <= 0] |
This file contains hidden or 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
Rebol [] | |
reverse-words: function [ | |
"Reverse the order of words. Modifies and returns string (series)" | |
series [string!] "At position (modified)" | |
][ | |
first-time: on | |
until [ | |
f: any [ | |
if first-time [tail series] |
This file contains hidden or 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
Rebol [] | |
; see - http://codegolf.stackexchange.com/questions/22268/convert-calendar-dates-to-week-dates-and-vice-versa | |
; | |
; Grrr.. question now doesn't allow languages that use date/time operators :( | |
; So here the beginning is my (not golfed) version prior to the change! :) | |
; | |
; 28-Feb-2014 | |
to-iso-week: func [date [date!] /local week-day last-year? week-in-year?] [ |
This file contains hidden or 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
Rebol [] | |
comma-quibbling: func [block] [ | |
rejoin [ | |
"^{" | |
to-string use [s] [ | |
s: copy block | |
s: next s | |
forskip s 2 [insert s either tail? next s [" and "] [", "]] |
This file contains hidden or 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
REBOL [ | |
Title: "Rebocalc" | |
Date: 19-Jun-2001 | |
Version: 1.0.0 | |
File: %rebocalc.r | |
Author: "Carl Sassenrath" | |
Purpose: {The world's smallest spreadsheet program, but very powerful.} | |
Email: %carl--rebol--com | |
library: [ | |
level: 'beginner |