Files
ioccc/1991/dds
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
..
2023-11-10 11:16:51 -08:00
2023-07-06 21:49:38 -07:00
2023-10-21 10:47:53 -07:00

To build:

    make all

To use:

    ./dds basic_program
    ./a.out 2>/dev/null

Try:

The author suggests trying:

    ./dds LANDER.BAS
    ./a.out

Notice that a file a.c has been generated. Can you tell how a.c was produced? How does a.c relate to LANDER.BAS?

What happens if you give the program a C program like itself? Try:

    ./dds dds.c

You'll get errors yes but what does the generated file look like? What about other types of files?

Judges' remarks:

This obfuscated program translates BASIC programs into obfuscated C programs by way of an obfuscated algorithm.

Author's remarks:

This program is a companion to the 1990/dds 1990 DDS-BASIC interpreter program. This compiles BASIC programs into compilable C code and then compiles it. The input format is almost identical to the input format of the DDS-BASIC interpreter. The program needs an executable C compiler called cc in your path in order to work.

Program commands:

  • variable names A to Z
  • FOR var = exp TO exp
  • GOSUB exp
  • GOTO exp
  • INPUT variable
  • PRINT exp
  • REM any text
  • variables initialized to 0 on RUN
  • NEXT variable
  • RETURN
  • IF exp THEN exp
  • PRINT string
  • var = exp
  • END

Expressions are the same as the expressions of the C language. Many system calls and C library calls can be used.

Input format:

  • Free format positioning of tokens on the line.
  • No space is allowed before the line number.
  • Exactly one space is needed after the FOR and NEXT tokens.
  • ALL INPUT MUST BE UPPERCASE.

Error checking / error reports:

The compiler silently ignores many errors. Other errors may produce errors in later phases of the compilation.

Can you figure out how the compiler works?

Hint:

The compiler is NOT written in C, so this is really a meta-obfuscated program. The C code is an interpreter for the four register, seven instruction COGNIMP$ machine that is contained in the s string. (COGNIMP$ is named after the symbolic names of the seven instructions it defines (Copy, Output, Goto, iNcrement, If, Match and Print).

The $ sign is used for labels. The actual compiler is written in COGNIMP$. Browsing through the COGNIMP$ code we encourage you to examine the loops for scanning the expression in the IF statement and the way a decision tree is implemented in order to match the statements. (Of course the s string is encoded by adding one to every character of it just to confuse you).