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
//A solution to Mike Hadlow's Journey coding challenge in F# | |
//Details here: https://github.com/mikehadlow/Journeys | |
//Inspiration from Mark Seemann's Haskell solution: | |
//https://blog.ploeh.dk/2019/10/28/a-basic-haskell-solution-to-the-robot-journeys-coding-exercise/ | |
[<Literal>] | |
let InputText = """1 1 E | |
RFRFRFRF | |
1 1 E |
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
open System | |
let checkLength s = | |
let len = Seq.length s | |
len >= 6 && len <= 16 | |
let checkDigits s = | |
let checkDigit c = Char.IsLetterOrDigit(c) || c = '-' | |
s |
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
.method assembly hidebysig | |
instance void '<Where>b__2' ( | |
valuetype IronStone.Moldinium.ListEvent`1<!TSource> v | |
) cil managed | |
{ | |
// Method begins at RVA 0x3cf4 | |
// Code size 660 (0x294) | |
.maxstack 5 | |
.locals init ( | |
[0] valuetype IronStone.Moldinium.ListEventType, |
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
using System; | |
using System.Linq; | |
using Microsoft.CodeAnalysis.CSharp; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; | |
using Microsoft.CodeAnalysis; | |
void Main() | |
{ | |
var code = @"namespace P | |
{ |