Skip to content

Instantly share code, notes, and snippets.

View judemelancon's full-sized avatar

Jude Melancon judemelancon

View GitHub Profile
@judemelancon
judemelancon / ToBanner.linq
Created March 30, 2019 17:10
This is a modern, improved version of the banner utility. It rasterizes the message with an arbitrary font then converts that to characters for output.
<Query Kind="Program">
<Namespace>System.ComponentModel</Namespace>
<Namespace>System.Drawing</Namespace>
<Namespace>System.Drawing.Imaging</Namespace>
<Namespace>System.Drawing.Text</Namespace>
<Namespace>System.Runtime.InteropServices</Namespace>
</Query>
// This is can be run in LINQPad ( http://www.linqpad.net/ ) in C# Program mode.
// A test suite is at the bottom.
// This is can be run in LINQPad ( http://www.linqpad.net/ ) in C# Program mode.
// Alternatively, it will work as a console project.
public static class EnumerableExtensions
{
/// <summary>This produces a string listing the elements sorted ascending where contiguous runs of integers are replaced with a range notation.</summary>
/// <param name="rangeDash">The default is a single en dash.</param>
/// <param name="separator">The default is a single comma.</param>
/// <param name="optimizeForSorted">If this is true, <paramref name="self"/> won't be sorted unless a problem is observed, in which case partial work will be discarded.
// This decodes the ??? entries from LYNE http://www.lynegame.com/
// They are part of the #solvelyne puzzle.
// This is can be run in LINQPad ( http://www.linqpad.net/ ) in C# Program mode, but it should also work as a single-class project.
// It is a direct translation of https://gist.github.com/BlaXpirit/9902067 by Oleh Prypin (BlaXpirit).
// It relies on data from http://blaxpirit.pythonanywhere.com/lyne/information .
// LYNE's Developer: Thomas Bowker http://thomasbowker.com/
// Discussion: http://steamcommunity.com/app/266010/discussions/0/558750717604246010/
// Mist ( http://steamcommunity.com/profiles/76561198025724101 ) appears to be the first to complete a substantial solution.
// BlaXpirit [UA] ( http://steamcommunity.com/id/blaxpirit ), again, gathered the information and wrote the Python Gist upon which this was based.