Skip to content
Sign upLog in
← Back to Community

#WEEKLY --- Multiply Challenge

Profile icon
raghavm

Multiply #WEEKLY Challenge:

Hey guys! Ok, so this is my entry:

  • Basically, I implemented a reducer-type function that keeps calling itself.
  • The reducer simply adds the number back to itself and calls the said function again.
  • This works because multiplication is repeated addition!

My original idea:

  • Originally, I was just going to divide by the reciprocal:
    • e.g. 2 * 3 = 6 becomes 2 / (1/3) = 6
    • I thought this was too easy though, so I didn't.

Comment for a cookie crunch crunch!

Voters
Profile icon
raghavm
Comments
hotnewtop
Profile icon
TheDrone7

You need to take user input instead of testing it yourself.

Profile icon
raghavm

@TheDrone7
oh epic will do

Profile icon
NoelB33

85A1BB91-7CF0-4CAD-9A3B-37A13C33A0F3

Profile icon
raghavm

@NoelBryan
shhhhhhh i fixed it now

Profile icon
NoelB33
Profile icon
raghavm
Profile icon
NoelB33

Also not sure if it counts but loops aren’t allowed at the bottom there’s a for loop

@raghavm