Skip to content

Instantly share code, notes, and snippets.

@xdaDaveShaw
xdaDaveShaw / Journeys.fsx
Created October 30, 2019 23:13
Solution to the Robot Journey coding challenge
//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
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
.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,
@xdaDaveShaw
xdaDaveShaw / RoslynBasedAttributeRemover.cs
Last active April 13, 2021 10:16
Roslyn Based Attribute Remover
using System;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis;
void Main()
{
var code = @"namespace P
{