Skip to main content
deleted 27 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1) = 1QAZ f("ZXCVB",2) = CVBNM f("HELLO",3) = LYDDW f("0PLM",11) = 1QSV f("0PLM",2130) = 0PHX 

#Rules


I think this will be interesting because numbers can be handled differentlyThis is slightly more difficult than lettersit seems at first glance.

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1) = 1QAZ f("ZXCVB",2) = CVBNM f("HELLO",3) = LYDDW f("0PLM",11) = 1QSV f("0PLM",2130) = 0PHX 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1) = 1QAZ f("ZXCVB",2) = CVBNM f("HELLO",3) = LYDDW f("0PLM",11) = 1QSV f("0PLM",2130) = 0PHX 

#Rules


This is slightly more difficult than it seems at first glance.

Tweeted twitter.com/StackCodeGolf/status/960519350590558208
added 23 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1)=1QAZ = 1QAZ f("ZXCVB",2)=CVBNM = CVBNM f("HELLO",3)=LYDDW = LYDDW f("0PLM",11) = 1QSV f("0PLM",2130) = 0PHX 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1)=1QAZ f("ZXCVB",2)=CVBNM f("HELLO",3)=LYDDW 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1) = 1QAZ f("ZXCVB",2) = CVBNM f("HELLO",3) = LYDDW f("0PLM",11) = 1QSV f("0PLM",2130) = 0PHX 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

deleted 8 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (non-empty alphaalpha-numeric capitalizedcapitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1)=1QAZ f("ZXCVB",2)=CVBNM f("HELLO",3)=LYDDW 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (non-empty alpha-numeric capitalized).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1)=1QAZ f("ZXCVB",2)=CVBNM f("HELLO",3)=LYDDW 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

Given the following input:

  • An integer n where n > 0.
  • A string s where s is not empty and s~=[0-9A-Z]+ (alpha-numeric capitals only).

Using a standard, simplified QWERTY keyboard (as shown below):

1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM 

Perform the following operation:

  • Find the original row that each character is in on the keyboard.
  • Replace the letter with the correct shifted equivalent for n based on its original position + n.
    • E.G. s="AB" and n=2: A would become D and B would become M.
  • If keyboard_row[position + n] > keyboard_row.length, wrap back to the start.
    • E.G. s="0P" and n=2: 0 would become 2 and P would become W.

#Examples:

f("0PLM",1)=1QAZ f("ZXCVB",2)=CVBNM f("HELLO",3)=LYDDW 

#Rules


I think this will be interesting because numbers can be handled differently than letters.

added 5 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140
Loading
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140
Loading