Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

50%
+0 −0
Challenges "Hello, World!"

SOS, 155 Bytes !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+! Explanation: Each ! o...

posted 2y ago by celtschk‭  ·  edited 2y ago by celtschk‭

Answer
#3: Post edited by user avatar celtschk‭ · 2022-04-14T06:49:48Z (about 2 years ago)
Added explanation
  • # [SOS](https://github.com/celtschk/SOS), 155 Bytes
  • !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+!
  • # [SOS](https://github.com/celtschk/SOS), 155 Bytes
  • !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+!
  • Explanation:
  • Each `!` outputs a single bit. That bit is 0 if the current stack is empty, and 1 otherwise. Initially the stack is empty. `+` adds something (an empty stack) to it, and `-` removes it. As soon as 8 bits are output, the corresponding byte is sent to stdout. Therefore the sequence up to the 8th `!`, `!+!-!!+!-!!!` outputs the bit sequence 01001000, which is the ASCII code for the letter H.
  • The last character uses the fact that if at the end of the program less than 8 bits are output, the value is left-padded with zeros, and the resulting byte is output. So with comments (and spaces to make the output commands line up), the program reads like this:
  • ```text
  • !+!-! !+!-! ! ! Output 01001000, i.e. H
  • !+! !-! !+!-!+! Output 01100101, i.e. e
  • -!+! !-!+! !-! ! Output 01101100, i.e. l
  • !+! !-!+! !-! ! Output 01101100, i.e. l
  • !+! !-!+! ! ! ! Output 01101111, i.e. o
  • -! !+!-!+! !-! ! Output 00101101, i.e. comma
  • ! !+!-! ! ! ! ! Output 00100000, i.e. space
  • !+!-!+!-!+! ! ! Output 01010111, i.e. W
  • -!+! !-!+! ! ! ! Output 01101111, i.e. o
  • -!+! ! !-! !+!-! Output 01110010, i.e. r
  • !+! !-!+! !-! ! Output 01101100, i.e. l
  • !+! !-! !+!-! ! Output 01100100, i.e. d
  • +!-! ! ! !+! Output 00100001, i.e. exclamation mark
  • ```
#2: Post edited by user avatar celtschk‭ · 2022-04-13T07:08:15Z (about 2 years ago)
Fixed formatting
  • [SOS](https://github.com/celtschk/SOS), 155 Bytes
  • !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+!
  • # [SOS](https://github.com/celtschk/SOS), 155 Bytes
  • !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+!
#1: Initial revision by user avatar celtschk‭ · 2022-04-13T07:06:25Z (about 2 years ago)
[SOS](https://github.com/celtschk/SOS), 155 Bytes

    !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+!