Skip to content

emadb/singlepath

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SinglePath

Can you get rid of all the IFs?

The game

Submit a snippet of code containing an if-then-else construct (or any other statements causing alternative paths of execution) and for which you believe the elimination of the conditional statement is impractical or too hard.

That is: send us a snippet of code where an if-then-else is unavoidable.

The goal

Collectively refactor the code, with the manifest and deliberate goal of eliminating the conditional path.

Then, reflect on the result. Was it worth the effort?

Rules

Everyone can submit a snippet of code. Just open a pull request.

Use the language you prefer: Java, C#, Python, whatever you want.

Just provide enough tests in order to make your intents clear.

This is the list of [quizzes] (https://github.com/code4nothing/singlepath/search?q=label%3Aquiz&ref=cmdform&type=Issues) and these are the suggested [responses] (https://github.com/code4nothing/singlepath/search?q=label%3Asolution&ref=cmdform&type=Issues)

How can I contribute?

Submit a new Quiz. Or, propose a solution to one of the open Quizzes.

About

Can you get rid of all the IFs?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 84.8%
  • C# 8.0%
  • Java 3.7%
  • Shell 2.4%
  • Groovy 1.1%