Calculator Speedrun - code a calculator as fast as possible in the programming language of your choice


Table of all speedruns | Bash (no external utilities) C# C11+ C89 / ANSI-C C99 HolyC Java POSIX sh Python 2 Python 3+ Rust Vanilla JavaScript
this is the stupidest thing ive ever made :):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):)

Rules:

  1. 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). The following languages don't have to support non-whole numbers in a run: Bash (no external utilities), POSIX sh
  2. 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.
  3. No copying/pasting or customized keyboard macros or software macros that type stuff out for you.
  4. Before starting the timer, you can put in any code that a standard IDE would normally automatically put in when you start a new project, if applicable. So for example, in Java you could create a .java file with public static void main(String[] args) { } before starting the timer. I won't go into specifics here cuz it should be fairly obvious for the most part, and I'll just accept whatever I want.
  5. The timer starts when you start writing your calculator code (on the first keystroke), and ends immediately when you finish (on the last keystroke).
  6. 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.
  7. You can't import external headers or libraries that aren't a part of the language's standard library.
  8. 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.
  9. Ensure that your code is as portable as the language that it is written in, and all code has clearly defined behavior.
  10. Do not use functions or methods to call other languages. For example, C's system() function is prohibited. This also means that bc isn't an allowed utility in the POSIX sh category.

If for some reason you want to do this, send an email to whaletuba at tutanota dot com with a video of your run. You can do the run in any programming language you want (if it's not already listed on the website, I'll probably add it).