From 3ea268b84066b20a4fb65d447ba7f40c7c573795 Mon Sep 17 00:00:00 2001 From: weichen-sf Date: Thu, 14 Aug 2025 10:12:14 -0400 Subject: [PATCH 1/2] Create TheFileLengthOfThisFileDoesntMatterAtAll.cs --- TheFileLengthOfThisFileDoesntMatterAtAll.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 TheFileLengthOfThisFileDoesntMatterAtAll.cs diff --git a/TheFileLengthOfThisFileDoesntMatterAtAll.cs b/TheFileLengthOfThisFileDoesntMatterAtAll.cs new file mode 100644 index 0000000..c63db56 --- /dev/null +++ b/TheFileLengthOfThisFileDoesntMatterAtAll.cs @@ -0,0 +1,19 @@ +using System; +using System.IO; +class Program{ + static void Main(string[] args){ + var values = new[]{1000,900,500,400,100,90,50,40,10,9,5,4,1}; + var symbols = new[]{"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"}; + foreach(var line in File.ReadLines(args[0])){ + int number = int.Parse(line); + var roman = ""; + for(int i = 0; i < values.Length; i++){ + while(number >= values[i]){ + roman += symbols[i]; + number -= values[i]; + } + } + Console.WriteLine(roman); + } + } +} From 74de3b11f6e2231da4cb3967e3179b1222b12fc6 Mon Sep 17 00:00:00 2001 From: weichen-sf Date: Thu, 14 Aug 2025 10:12:38 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index f7fdde3..ab75211 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,8 @@ if __name__ == "__main__": This repo contains a [sample file](https://github.com/kevsmith/code_golf/blob/main/input.txt) you can use for development. +#### HOW TO RUN +dotnet new console --use-program-main false +Copy contents from TheFileLengthOfThisFileDoesntMatterAtAll.cs to Program.cs +Delete TheFileLengthOfThisFileDoesntMatterAtAll.cs file +dotnet run input.txt