Skip to main content
added 43 characters in body
Source Link
Dion
  • 4k
  • 12
  • 42

MAWP, 34 33 24 23 bytes

`|_=M0=A0/[M%{0:.}?`]1:

Try it!

Thanks to @Razetime for saving 9 bytes!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
?`       If 0 then pop value
]        End of loop
1:       Print 1

MAWP, 34 33 24 23 bytes

`|_=M0=A0/[M%{0:.}?`]1:

Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
?`       If 0 then pop value
]        End of loop
1:       Print 1

MAWP, 34 33 24 23 bytes

`|_=M0=A0/[M%{0:.}?`]1:

Try it!

Thanks to @Razetime for saving 9 bytes!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
?`       If 0 then pop value
]        End of loop
1:       Print 1
added 6 characters in body
Source Link
Dion
  • 4k
  • 12
  • 42

MAWP, 34 33 2424 23 bytes

`|_=M0=A0/[M%{0:.}<`>]1?`]1:

Try it!Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
<`>?`       If 0 then pop value
]        End of loop
1:       Print 1

MAWP, 34 33 24 bytes

`|_=M0=A0/[M%{0:.}<`>]1:

Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
<`>      If 0 then pop value
]        End of loop
1:       Print 1

MAWP, 34 33 24 23 bytes

`|_=M0=A0/[M%{0:.}?`]1:

Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
?`       If 0 then pop value
]        End of loop
1:       Print 1
deleted 115 characters in body
Source Link
Dion
  • 4k
  • 12
  • 42

MAWP 2.0, 34 3333 24 bytes

`|_=M0=A0/[M%/]/[A1+=A*MA-<{0:.>]1}<`>]1:

Try it!Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[M%/]    Modulo each value on stack by M
/        Cycle stack
[        Start of loop
A1+=AM%    Add 1 to AModulo by M
*{0:.}    If not 0 then Multiplyprint top0 ofand stackterminate
MA-<`>      If done M iterations...
<:.>   0 ...then print 0 andpop terminatevalue
]        End of loop
1:       Print 1

MAWP 2.0, 34 33 bytes

`|_=M0=A0/[M%/]/[A1+=A*MA-<:.>]1:

Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[M%/]    Modulo each value on stack by M
/        Cycle stack
[        Start of loop
A1+=A    Add 1 to A
*        Multiply top of stack
MA-      If done M iterations...
<:.>    ...then print 0 and terminate
]        End of loop
1:       Print 1

MAWP, 34 33 24 bytes

`|_=M0=A0/[M%{0:.}<`>]1:

Try it!

Explanation:

`        Remove starting 1 on stack
|        Push input on stack as ASCII codes
_=M      Set variable M to length of stack (length of input)
0=A      Set variable A to 0
0/       Push 0 and cycle stack
[        Start of loop
M%       Modulo by M
{0:.}    If not 0 then print 0 and terminate
<`>      If 0 then pop value
]        End of loop
1:       Print 1
added 8 characters in body
Source Link
Dion
  • 4k
  • 12
  • 42
Loading
added 490 characters in body
Source Link
Dion
  • 4k
  • 12
  • 42
Loading
Source Link
Dion
  • 4k
  • 12
  • 42
Loading