Skip to main content
deleted 3 characters in body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142

Perl, 5956 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/.\K\B\B/ /g 

Counting the shebang as 3, input is taken from stdin. If a leading newline isn't a concern for inputs p and l, then /$_\n?/ could be replaced with a bare $_ to save 4.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 

Perl, 59 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/.\K\B/ /g 

Counting the shebang as 3, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 

Perl, 56 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/\B/ /g 

Counting the shebang as 3, input is taken from stdin. If a leading newline isn't a concern for inputs p and l, then /$_\n?/ could be replaced with a bare $_ to save 4.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 
edited body
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142

Perl, 59 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/.\K\B/ /g 

Counting the shebang as 43, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 

Perl, 59 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/.\K\B/ /g 

Counting the shebang as 4, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 

Perl, 59 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/.\K\B/ /g 

Counting the shebang as 3, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 
edit for leading newlines before p and l
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142

Perl, 5659 bytes

#!perl -plp 'qwertyuiop asdfghjkl zxcvbnm'=~$_;$_=$';szxcvbnm'=~/$_ ?/;$_=$';s/.\K\B/ /g 

Counting the shebang as 4, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 

Perl, 56 bytes

#!perl -pl 'qwertyuiop asdfghjkl zxcvbnm'=~$_;$_=$';s/.\K\B/ /g 

Counting the shebang as 4, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 

Perl, 59 bytes

#!perl -p 'qwertyuiop asdfghjkl zxcvbnm'=~/$_ ?/;$_=$';s/.\K\B/ /g 

Counting the shebang as 4, input is taken from stdin.


Sample Usage

$ echo g|perl qwerty.pl h j k l z x c v b n m $ echo v|perl qwerty.pl b n m 
Source Link
primo
  • 33.7k
  • 5
  • 63
  • 142
Loading