C# Puzzles
Two C# programming puzzles challenge participants to modify functions for specific outputs, emphasizing string manipulation without using `Environment.Exit(0)`, suitable for C# 7 or above, with hints for unconventional solutions.
Read original articleThe message discusses two C# programming puzzles that involve manipulating code to achieve specific output. The first puzzle, titled "Format Fun," requires the participant to modify a function called `SecretSauce` to change the output of a `StringBuilder` from "Bye Bye" to "Hello" when printed. The goal is to ensure that the program reaches the return statement of 0 without using `Environment.Exit(0)`. The second puzzle, "Double Fun," similarly involves modifying another `SecretSauce` function to make the combined output of two `StringBuilder` objects read "Hello, World!" The puzzles emphasize creativity in coding and understanding of string manipulation in C#. Hints are provided for both puzzles, suggesting that the solutions may involve unconventional methods. The puzzles are designed for C# version 7 or above and are intended for a single machine environment without unsafe code practices.
- The puzzles focus on string manipulation in C#.
- Participants must modify a function to achieve specific output.
- Solutions should not use `Environment.Exit(0)`.
- The puzzles are suitable for C# version 7 or above.
- Hints suggest unconventional coding techniques.
Related
Solving puzzles faster than humanly possible
The Opus Magnum challenge tasks players with automating puzzle-solving to optimize Cost, Cycles, and Area metrics. Participants submit solutions for evaluation, exploring automated vs. human strategies, hybrid approaches, scoring systems, mods, and bots.
Weekend projects: getting silly with C
The C programming language's simplicity and expressiveness, despite quirks, influence other languages. Unconventional code structures showcase creativity and flexibility, promoting unique coding practices. Subscription for related content is encouraged.
A Curried Composition Puzzle
The post presents a puzzle on creating a three-fold composition function from a two-fold function in Lambda calculus, Haskell, Scheme, and JavaScript, emphasizing visualization and proposing further challenges.
Polyglot Maxxie and Minnie
The blog post details the "Maxxie and Minnie" programming challenge, focusing on finding the largest and smallest numbers from digit swaps, with solutions in various programming languages and reflections on learning experiences.
Generating Lever-Door Puzzles with JavaScript
The article details the creation of lever-door puzzles for a browser MMO, utilizing a JavaScript script and graph structures to generate complex puzzles, with code available on GitHub.
For the second, the given answer is definitely cheating. On the other hand, I definitely had no idea any of that existed. IMO it'd have been cleaner to 'simply' modify the running program instead.
Related
Solving puzzles faster than humanly possible
The Opus Magnum challenge tasks players with automating puzzle-solving to optimize Cost, Cycles, and Area metrics. Participants submit solutions for evaluation, exploring automated vs. human strategies, hybrid approaches, scoring systems, mods, and bots.
Weekend projects: getting silly with C
The C programming language's simplicity and expressiveness, despite quirks, influence other languages. Unconventional code structures showcase creativity and flexibility, promoting unique coding practices. Subscription for related content is encouraged.
A Curried Composition Puzzle
The post presents a puzzle on creating a three-fold composition function from a two-fold function in Lambda calculus, Haskell, Scheme, and JavaScript, emphasizing visualization and proposing further challenges.
Polyglot Maxxie and Minnie
The blog post details the "Maxxie and Minnie" programming challenge, focusing on finding the largest and smallest numbers from digit swaps, with solutions in various programming languages and reflections on learning experiences.
Generating Lever-Door Puzzles with JavaScript
The article details the creation of lever-door puzzles for a browser MMO, utilizing a JavaScript script and graph structures to generate complex puzzles, with code available on GitHub.