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
let insert db contact = | |
if db.number_of_contacts >= Array.length db.contacts then | |
(false, db, nobody) | |
else | |
let (status, db, _) = search db contact in | |
if status then (false, db, contact) else | |
let cells i = | |
if i = db.number_of_contacts then contact else db.contacts.(i) | |
in | |
let db' = { |
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
Red [] | |
html: { | |
<html> | |
<head><title>Test</title></head> | |
<body><div><u>Hello</u> <b>World</b></div></body> | |
</html> | |
} | |
ws: charset reduce [space tab cr lf] |
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
i: "1#11^/2#22^/" | |
b: copy [] | |
parse i [collect into b [copy l some digit "#" copy r some digit newline]] | |
; == false | |
probe l | |
; == "1" | |
probe r | |
; "11" | |
; == true | |
probe b |
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
Red [ | |
Title: "Advent of Code 2018 - Day 07 - Part 01" | |
Date: 2018-12-15 | |
File: %day07_part01.red | |
Author: "Luis Vale Mendes" | |
Version: 0.0.1 | |
] | |
time-start: now/time/precise |
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
Step C must be finished before step A can begin. | |
Step C must be finished before step F can begin. | |
Step A must be finished before step B can begin. | |
Step A must be finished before step D can begin. | |
Step B must be finished before step E can begin. | |
Step D must be finished before step E can begin. | |
Step F must be finished before step E can begin. |