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

Commonmark migration
Source Link

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Prints a trailing space

###How It Works

How It Works

,[>++++[-<-------->],] Puts input on the tape and subtracts 32 from each character
 This separates each word
>+[- Start the loop
 <[>++++[<++++++++>-]<[->>+<<]<] Add 32 to each letter of the word
 Skip this on the first iteration for the last word
 <<[->>+<<]>[[-<+>]>] Swaps the last two letters of the word
 <<[>+>+>]- If there is another word to the left continue loop
 Also set up to add a space to the end of the word
 <] End loop
 >>>>>>>[.>] Print the modified string

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Prints a trailing space

###How It Works

,[>++++[-<-------->],] Puts input on the tape and subtracts 32 from each character
 This separates each word
>+[- Start the loop
 <[>++++[<++++++++>-]<[->>+<<]<] Add 32 to each letter of the word
 Skip this on the first iteration for the last word
 <<[->>+<<]>[[-<+>]>] Swaps the last two letters of the word
 <<[>+>+>]- If there is another word to the left continue loop
 Also set up to add a space to the end of the word
 <] End loop
 >>>>>>>[.>] Print the modified string

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Prints a trailing space

How It Works

,[>++++[-<-------->],] Puts input on the tape and subtracts 32 from each character
 This separates each word
>+[- Start the loop
 <[>++++[<++++++++>-]<[->>+<<]<] Add 32 to each letter of the word
 Skip this on the first iteration for the last word
 <<[->>+<<]>[[-<+>]>] Swaps the last two letters of the word
 <<[>+>+>]- If there is another word to the left continue loop
 Also set up to add a space to the end of the word
 <] End loop
 >>>>>>>[.>] Print the modified string

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

-9 bytes + explanation
Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Prints a trailing space

###How It Works

,[>++++[-<-------->],] Puts input on the tape and subtracts 32 from each character
 This separates each word
>+[- Start the loop
 <[>++++[<++++++++>-]<[->>+<<]<] Add 32 to each letter of the word
 Skip this on the first iteration for the last word
 <<[->>+<<]>[[-<+>]>] Swaps the last two letters of the word
 <<[>+>+>]- If there is another word to the left continue loop
 Also set up to add a space to the end of the word
 <] End loop
 >>>>>>>[.>] Print the modified string

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Prints a trailing space

###How It Works

,[>++++[-<-------->],] Puts input on the tape and subtracts 32 from each character
 This separates each word
>+[- Start the loop
 <[>++++[<++++++++>-]<[->>+<<]<] Add 32 to each letter of the word
 Skip this on the first iteration for the last word
 <<[->>+<<]>[[-<+>]>] Swaps the last two letters of the word
 <<[>+>+>]- If there is another word to the left continue loop
 Also set up to add a space to the end of the word
 <] End loop
 >>>>>>>[.>] Print the modified string

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

-9 bytes
Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187

brainfuck, 109(削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

brainfuck, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

brainfuck, (削除) 109 (削除ここまで) 100 bytes

Edit: don’t have to handle one letter words

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[->>+<<]>[[-<+>]>]<<[>+>+>]-<]>>>>>>>[.>]

Try it online!

Previous version, 109 bytes

,[>++++[-<-------->],]>+[-<[>++++[<++++++++>-]<[->>+<<]<]<<[[->>+<<]>[[-<+>]>]<<[<]]>[>]<[>+>+>]-<]>>>>>>[.>]

Try it online!

Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187
Loading

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