DEV Community

Caleb (pxlmastr)
Caleb (pxlmastr)

Posted on

Free Follow(s) Challenge: Who can code a Number parser from Scratch?

I'm sure y'all know how this works...

Instructions

  • Code a number parser from scratch in the language of your choice. Make it so it take a String (or whatever is a string in the language) and is able to parse it and turn it into a number.
  • If you want an extra challenge, add support for decimals as well!!!

Restrictions

  • You may NOT use ANY built-in parsing function, because this is a challenge to test problem-solving skills.
  • No ChatGPT (or any other AI) or begging people on Stack Overflow for help.

Reward

If you are finish with all restrictions met, you will recieve a free follow from both me and potentially others for sharing your (hopefully) amazing code with the community.

Good Luck Everyone!!!

Wanna support me? Click the link and watch an ad. (or two, or three, or more maybe)

Top comments (3)

Collapse
 
lexlohr profile image
Alex Lohr
const parse = (input, num = 0) =>
  input
  ? parse(input.slice(1), num * 10 + input.charCodeAt() - 48)
  : num;
Enter fullscreen mode Exit fullscreen mode
Collapse
 
pxlmastrxd profile image
Caleb (pxlmastr)

GG, good parser

Collapse
 
pxlmastrxd profile image
Caleb (pxlmastr)

Submit your code with a code block in these comments. Once again, good luck guys!