Calculator Speedrun - code a calculator as fast as possible in the programming language of your choice
Table of all speedruns | C#
- In this speedrun, you must program a basic four-function calculator capable of reading user input for two numbers to perform a user-specified operation on (addition, subtraction, multiplication, or division). The format in which you take input doesn't matter, so you can just pick whatever is fastest to code. The correct result must be printed to the screen. The calculator should work with non-whole numbers (e.g. 13/4 should return 3.25 or something equivalent).
- The user must only have to input the two numbers and the operation (and whitespace and newlines or whatver). If the user has to type any other information for the code to work, then your program is considered incomplete and your run is invalid.
- No copying/pasting or customized keyboard macros or software macros that type stuff out for you. This includes IDE-provided auto-pairing and auto-complete.
- You must start with a blank slate. No code can be inserted before the timer starts. Any code that is automatically generated must be deleted before the timer starts.
- The timer starts when you start writing your calculator code (on the first keystroke), and ends immediately when you finish (on the last keystroke).
- You must show the program working properly in the same video as your run once the timer has stopped. If your program doesn't work 100% correctly, the run is considered a failure and you must restart (or you could keep going if you're okay with having a terrible time).
- You can't import external headers or libraries that aren't a part of the language's standard library.
- You can't type your code into an interactive prompt; you must create a standalone program and run it on its own. When in doubt, don't try to cleverly scoot around the rules because I am the almighty and will reject your submission if you do that.
- Ensure that your code is as portable as the language that it is written in, and all code has clearly defined behavior. Compiler warnings are totally okay, so long as behavior is technically defined.
- Do not use functions or methods to call other languages. This means kernel syscalls that launch other programs are prohibited (as well as any functions that wrap around said syscalls).
If for some reason you want to do this, send an email to sebastian at sebsite dot pw with a video of your run. You can do the run in any programming language / category that you want (if it's not already listed on the website, I'll probably add it).