Files
ioccc/1998/dorssel
Landon Curt Noll f29b37e49a improve HTML menus, add social.html, prep for IOCCC28 winners
Prepare for the winners of **IOCCC28**.

> However these are not the 2024 droids you are looking for.  :-)

The HTML menu (both JavaScript and non-JavaScript) has been updated.

The `Status -> Rules and guidelines' have been replaced with two
separate menus `Status -> IOCCC rules` and `Status -> IOCCC guidelines`.

Added a new top level `social.html` page: built from a new `social.md`.

Sorted rules for building specific web pages in the top level `Makefile`.
Added `make social` to make the `social.html` page from `social.md`.

The `bin/gen-top-html.sh` now is able to process a argument of **social**
to process the new top level `social.html` page.

Changed `bin/gen-top-html.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-07-25".

Below `About -> Home page` a new `About -> IOCCC social media` menu item
as added.

Because the menu change touched every HTML file, we changed the general
copyright date range for HTML files from "1984-2024" to "1984-2025"
due to the extensive changes made for **IOCCC28**.

Those markdown files that were modified in 2025 had their copyright date
range also changed from "1984-2024" to "1984-2025".

Rebuilt tarballs and sitemap due to the extensive HTML rebuilding.

Ran `make update` to perform the above.
2025-07-26 13:06:29 -07:00
..
2022-09-18 23:37:49 -07:00
2023-07-06 21:49:38 -07:00
2024-07-29 08:47:22 -07:00

To build:

    make all

To use:

    ./dorssel
    # input some text

    echo text | ./dorssel

Try:

    ./try.sh

Judges' remarks:

How does the program decide which way to convert?

What obsolescent feature are we talking about? (No, it's not a C language feature.)

The author suggests that you try to answer the following questions:

  • Which character in the initializing string is totally irrelevant?

  • Which two relevant characters in the initializing string may be exchanged without altering the behavior?

  • Which characters in the initializing string are somewhat irrelevant, and to what values may they be changed without altering the behavior?

  • Which characters may be used to enlarge the initializing string by one without altering the behavior ?

Extra credit:

Try doing what the last part of the last command in try.sh suggests. As in, do the following:

    echo ". -..- . .-. -.-. .. ... .
    -.-. .... .- -. --. .  - .... .  .--. .-. --- --. .-. .- --  ... ---  .. -  -.. --- . ...  -. --- -  ... .... --- ..- -" | ./dorssel

and make the necessary adjustments.

You might also want to read the dorssel.html file.

Author's remarks:

Usage

This program converts ASCII to Morse code, and vice versa.

The program reads in lines from standard input and writes its result to standard output. The direction of conversion is determined on a per line basis. Each line must consist of a maximum of 952 characters followed by a new line character and they must not contain any NUL characters. Otherwise, some characters may be lost in the conversion.

  • Encoding to Morse code: The program knows the Morse codes for all Latin letters (a-z, case insensitive) and decimal digits (0-9). Any other characters are replaced by an ASCII space, ' '. Morse code per converted character is written as a sequence of . and - characters, each sequence followed by a space.

  • Decoding from Morse code: Morse code should be typed as sequences of . and - characters, separated by a space. Extra spaces will be echoed back (to separate words). Unknown sequences will be converted to a ? character.

Notes

The program assumes both source and execution character sets to be ASCII. As far as I can tell, the program is conforming and does not invoke undefined behavior.

Hints

Try:

    ./dorssel < dorssel.c | ./dorssel

to see what variables, numbers, and functions are used. (Does a better job than most C beautifiers).

  • Filter your text twice (as in the previous sample) to obtain a version of your text that can be reversibly Morsified, i.e.
    ./dorssel < dorssel.c | ./dorssel | ./dorssel | ./dorssel

is the same as

    ./dorssel < dorssel.c | ./dorssel

NOTICE to those who wish for a greater challenge:

If you want a greater challenge, don't read any further: just try to understand the program without running the command below. If you get stuck, come back and read the below.

The file dorssel.html contains all the information needed to understand this program.

For more information you might also try:

    ./dorssel < dorssel.md