about summary refs log tree commit diff stats
path: root/archive
Commit message (Expand)AuthorAgeFilesLines
* 6155Kartik Agaram2020-03-201-1/+3
* 6066 - Vim syntax highlighting for Mu filesKartik Agaram2020-02-281-1/+1
* 5960Kartik Agaram2020-01-301-0/+1
* 5959Kartik Agaram2020-01-301-1/+1
* 5853Kartik Agaram2020-01-013-135/+0
* 5852Kartik Agaram2020-01-01232-3/+3
* 5787Kartik Agaram2019-12-026-18/+262
* 5494Kartik Agaram2019-07-271-0/+11
* 5485 - promote SubX to top-levelKartik Agaram2019-07-27229-0/+80488
weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# example program: creating and using global variables

def main [
  # allocate 5 locations for globals
  global-space:space <- new location:type, 5
  # read to globals by using /space:global
  1:num/space:global <- copy 3
  foo
]

def foo [
  # ditto for writing to globals
  $print 1:num/space:global, 10/newline
]
class="o">.Value]) else None let splitPattern str = match str with | Regex [marker; rest] -> marker, rest | _ -> "", "" let rec decrypt str = if str = "" then "" else let marker, rest = splitPattern str if marker = "" then string str[0] + decrypt str[1..] else let nums = marker.Split 'x' |> Array.map int let start, count = (min nums[0] (String.length rest)), nums[1] String.replicate count rest[..start-1] + decrypt rest[start..] let rec decryptLength str = if str = "" then bigint 0 else let marker, rest = splitPattern str if marker = "" then bigint 1 + decryptLength str[1..] else let nums = marker.Split 'x' |> Array.map int let start, count = (min nums[0] (String.length rest)), nums[1] bigint count * decryptLength rest[..start-1] + decryptLength rest[start..] let lines = File.ReadLines "day9.txt" lines |> Seq.map decrypt |> Seq.map String.length |> Seq.reduce (+) |> printfn "%d" lines |> Seq.map decryptLength |> Seq.reduce (+) |> printfn "%A" re>fca1fc4f ^
f70ee6b2 ^
0db4c9b2 ^
b2d63ef5 ^
291ca616 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60