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.Collections.Generic; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace ancientcode { | |
public class TextManager { | |
private TextManagerHelper hlp = new TextManagerHelper(); | |
private Random rnd = new Random(); |
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
class RollMade { | |
public int Pins; | |
} |
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.Linq; | |
using System.Collections.Generic; | |
class BowlingGameBareBones | |
{ | |
#region Event definitions | |
abstract class Event {} | |
class Rolled : Event { | |
public uint Pins; |
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using Newtonsoft.Json; // NuGet package dependency | |
namespace eventorientation | |
{ |
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
public static class Experimenter | |
{ | |
private static ILogging __log; | |
public static void Init(ILogging log) => __log = log; | |
public static bool Try(string logMsg, Action experiment) | |
{ | |
try | |
{ |
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
_ _ _ _ _ _ _ | |
| _| _||_||_ |_ ||_||_| | |
||_ _| | _||_| ||_| _| | |
_ _ _ _ _ _ _ | |
|_||_|| || ||_ | | ||_ | |
| _||_||_||_| | | | _| |
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
void Classify(string number, Action<int> onArabic, Action<string> onRoman) { | |
if (int.TryParse(number, out var arabicNumber)) | |
onArabic(arabicNumber); | |
else | |
onRoman(number); | |
} | |
/* | |
* Note how all details about how classification works are hidden in the function Classify(). | |
* It's not visible to the outside wheter an "if" is used or a table lookup or whatever. |
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; | |
namespace layered | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) { | |
var data = new DataLayer(); | |
var business = new BusinessLayer(data); |
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; | |
namespace terraingenBlog | |
{ | |
public class TerrainGenerator { | |
public static void Interpolate(Terrain terrain, float offset, float amplitude) { | |
Interpolate(terrain, offset, amplitude, Random_numbers_between_minus_1_and_1()); | |
} |
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
module Main exposing(main) | |
import Html exposing (Html, div, span, br, text, table, tr, td, button) | |
import Html.Attributes exposing (style) | |
import Html.App exposing (beginnerProgram) | |
import Html.Events exposing (onClick) | |
import Array exposing (Array) | |
import List |
NewerOlder