Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

typo in my name :-)
Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, (削除) 63 (削除ここまで) (削除) 62 (削除ここまで) 61 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe

-1 byte adding a line break in place of \n

-1 byte thanks to Robin RiderRyder

for(l in utf8ToInt(scan(,""))-96)cat(letters[l:0],'
',sep="")

Try it online!

R, 86 bytes (my original answer)

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

R, (削除) 63 (削除ここまで) (削除) 62 (削除ここまで) 61 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe

-1 byte adding a line break in place of \n

-1 byte thanks to Robin Rider

for(l in utf8ToInt(scan(,""))-96)cat(letters[l:0],'
',sep="")

Try it online!

R, 86 bytes (my original answer)

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

R, (削除) 63 (削除ここまで) (削除) 62 (削除ここまで) 61 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe

-1 byte adding a line break in place of \n

-1 byte thanks to Robin Ryder

for(l in utf8ToInt(scan(,""))-96)cat(letters[l:0],'
',sep="")

Try it online!

R, 86 bytes (my original answer)

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

added 19 characters in body
Source Link
Sumner18
  • 1.9k
  • 10
  • 20

R, (削除) 63 (削除ここまで) 62(削除) 62 (削除ここまで) 61 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe (give him 5 minutes he'll have it down to 50)

-1 byte adding a line break in place of \n

-1 byte thanks to Robin Rider

for(l in utf8ToInt(scan(,""))-96)cat(intToUtf8((lletters[l:97)[l>32])0],'
',sep="")

Try it online! Try it online!

R, 86 bytes (my original answer)

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

R, (削除) 63 (削除ここまで) 62 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe (give him 5 minutes he'll have it down to 50)

-1 byte adding a line break in place of \n

for(l in utf8ToInt(scan(,"")))cat(intToUtf8((l:97)[l>32]),'
')

Try it online!

R, 86 bytes

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

R, (削除) 63 (削除ここまで) (削除) 62 (削除ここまで) 61 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe

-1 byte adding a line break in place of \n

-1 byte thanks to Robin Rider

for(l in utf8ToInt(scan(,""))-96)cat(letters[l:0],'
',sep="")

Try it online!

R, 86 bytes (my original answer)

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

added 7 characters in body
Source Link
Sumner18
  • 1.9k
  • 10
  • 20

R, 63(削除) 63 (削除ここまで) 62 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe (give him 5 minutes he'll have it down to 50)

-1 byte adding a line break in place of \n

for(l in utf8ToInt(scan(,"")))cat(intToUtf8((l:97)[l>32]),'\n''
')

Try it online! Try it online!

R, 86 bytes

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

R, 63 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe (give him 5 minutes he'll have it down to 50)

for(l in utf8ToInt(scan(,"")))cat(intToUtf8((l:97)[l>32]),'\n')

Try it online!

R, 86 bytes

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

R, (削除) 63 (削除ここまで) 62 bytes

-16 bytes thanks to Giuseppe

-7 more bytes, again, thanks to Giuseppe (give him 5 minutes he'll have it down to 50)

-1 byte adding a line break in place of \n

for(l in utf8ToInt(scan(,"")))cat(intToUtf8((l:97)[l>32]),'
')

Try it online!

R, 86 bytes

x=utf8ToInt(scan(,''));s=sapply;cat(gsub(" .+"," ",s(s(x,`:`,97),intToUtf8)),sep="\n")

Ungolfed:

x=utf8ToInt(scan(,'')) #Takes input, converts to ASCII
s=sapply; #Alias sapply function to save a byte
 s(x,`:`,97) #Create vector from 97 to respective ASCII value
 s( ,intToUtf8) #Convert to character
 gsub(" .+"," ", ) #Removes everything after space
cat( ,sep="\n") #Outputs to console

Try it online!

Could likely be golfed.

NOTE: It does not use recursion. I do not know whether that would be shorter or not. I'll experiment later.

added 7 characters in body
Source Link
Sumner18
  • 1.9k
  • 10
  • 20
Loading
added 417 characters in body
Source Link
Sumner18
  • 1.9k
  • 10
  • 20
Loading
added 359 characters in body
Source Link
Sumner18
  • 1.9k
  • 10
  • 20
Loading
Source Link
Sumner18
  • 1.9k
  • 10
  • 20
Loading

AltStyle によって変換されたページ (->オリジナル) /