DEV Community

bingkahu (Matteo)
bingkahu (Matteo)

Posted on

Daily Challenge #1 : The "Time Traveler" Debugging Quest

Ever looked at a piece of code and wondered if the original developer was a wizard or just needed a nap? Today, you are that developer.

The Mission

Create a function that calculates the Factorial of a number, BUT there’s a catch (or three).

The Illegal Moves 🚫

To pass this challenge, your code CANNOT use:

  1. Loops (for, while, do-while)
  2. Recursion (No calling the function inside itself!)
  3. The Number Keys (You cannot type the digits 0-9 anywhere in your script).

The Goal 🏆

Write a snippet that takes n and returns n!.

Example: Input: 5
Output: 120


How to enter:

Paste your solution in the comments!

  • Bonus points if you explain how you bypassed the "no numbers" rule.
  • Extra credit if your solution is readable (though, let's be honest, it probably won't be).

Go wild. If this is too "big brain" for a Friday, feel free to just drop a GIF of your brain melting

have fun...

Top comments (0)