Skip to main content
Commonmark migration
Source Link

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

#0000000000 > 9 iterations > 0000000009

0000000000 > 9 iterations > 0000000009

and after that a to z is used:

#000000000a > 25 iterations > 000000000z

000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

#000000010

000000010

###Further rules:

Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

#0000000000 > 9 iterations > 0000000009

and after that a to z is used:

#000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

#000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

0000000000 > 9 iterations > 0000000009

and after that a to z is used:

000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

000000010

Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"
Notice removed Reward existing answer by ETHproductions
Bounty Ended with crashoz's answer chosen by ETHproductions

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

#0000000009#0000000000 > 9 iterations > 0000000009

(incrementing 9 times)

and after that a to z is used:

#000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

#000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

#0000000009

(incrementing 9 times)

and after that a to z is used:

#000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

#000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

#0000000000 > 9 iterations > 0000000009

and after that a to z is used:

#000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

#000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"
Notice added Reward existing answer by ETHproductions
Bounty Started worth 50 reputation by ETHproductions
deleted 29 characters in body
Source Link
Jack Hales
  • 359
  • 2
  • 10

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

0000000000

#0000000009

(incrementing 9 times)

0000000009

and after that a to z is used:

loop 25 times to 10

#000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

000000010

#000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

0000000000

(incrementing 9 times)

0000000009

and after that a to z is used:

loop 25 times to 10

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"

This is a code golf version of a similar question I asked on stack earlier but thought it'd be an interesting puzzle.

Given a string of length 10 which represents a base 36 number, increment it by one and return the resulting string.

This means the strings will only contain digits from 0 to 9 and letters from a to z.

Base 36 works as follows:

The right most digit is incremented, first by using 0 to 9

#0000000009

(incrementing 9 times)

and after that a to z is used:

#000000000a > 25 iterations > 000000000z

If z needs to be incremented it loops back to zero and the digit to its left is incremented:

#000000010

###Further rules:

  • You may use upper case or lower case letters.
  • You may not drop leading zeros. Both input and output are strings of length 10.
  • You do not need to handle zzzzzzzzzz as input.

###Test Cases:

"0000000000" -> "0000000001"
"0000000009" -> "000000000a"
"000000000z" -> "0000000010"
"123456zzzz" -> "1234570000"
"00codegolf" -> "00codegolg"
Tweeted twitter.com/StackCodeGolf/status/1023266986623725568
Post Reopened by Jo King, lynn, Οurous, O.O.Balance, Laikoni
edited body
Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115
Loading
I rewrote the challenge based on your comments. Feel free to revert the edit if you don't like it or keep only some parts of it.
Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115
Loading
Post Closed as "Needs details or clarity" by Matthew Roh, xnor, Timtech, Luis felipe De jesus Munoz, user202729
edited tags
Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading
explained the bonus better
Source Link
Jack Hales
  • 359
  • 2
  • 10
Loading
deleted 6 characters in body
Source Link
Jack Hales
  • 359
  • 2
  • 10
Loading
explained the goal
Source Link
Jack Hales
  • 359
  • 2
  • 10
Loading
nice images
Source Link
Jack Hales
  • 359
  • 2
  • 10
Loading
Source Link
Jack Hales
  • 359
  • 2
  • 10
Loading