summary refs log tree commit diff stats
path: root/client/public/manifest.json
blob: 9453a45818f4b55fbd68e6f5c8b16af87d6d8d76 (plain) (blame)
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
{
    "short_name": "M³",
    "name": "MyMedMemoir",
    "icons": [
        {
            "src": "favicon.ico",
            "sizes": "64x64 32x32 24x24 16x16",
            "type": "image/x-icon"
        },
        {
            "src": "logo192.png",
            "type": "image/png",
            "sizes": "192x192"
        },
        {
            "src": "logo512.png",
            "type": "image/png",
            "sizes": "512x512"
        }
    ],
    "start_url": ".",
    "display": "standalone",
    "theme_color": "#000000",
    "background_color": "#ffffff"
}
pan class="n">Groups -> g.Value]) else None let validChecksum (info: string * int * string) = let (name, idNum, checksum) = info let counts = name |> String.filter ((<>) '-') |> Seq.toList |> List.countBy id |> List.sortBy fst |> List.sortBy (snd >> fun x -> -x) let topFive = (List.map fst counts)[0..4] |> Seq.map string|> String.concat "" if topFive = checksum then idNum else 0 let getInfo string = match string with | Regex "([a-z\-]*)-(\d+)\[([a-z]{5})\]" [name; id; checksum] -> (name, int id, checksum) | _ -> ("", 0, "") let totalChecksum = List.map (getInfo >> validChecksum) >> List.sum // part 1 totalChecksum lines |> printfn "%A" // part 2 let decrypt (offset: int) (letter: char) : string = match letter with | '-' -> " " | _ -> int letter |> fun x -> x - (int 'a') + offset |> fun x -> x % 26 |> ((+) (int 'a')) |> Convert.ToChar |> string let decryptValid (info: string * int * string) = let (name, idNum, checksum) = info Seq.toList name |> List.map (decrypt idNum) |> String.concat "", idNum let decrypted = List.map (getInfo >> decryptValid) >> List.filter (fst >> fun x -> x.Contains "north") decrypted lines |> printfn "%A"