fix Makefile and README.md for 2012/deckmyn
This commit is contained in:
1 parent
3d0379b9f6
commit
2bbac22885
2 files changed
+235
-110
No files matched your search
+31
-30
@@ -1,24 +1,29 @@
|
||||
# Most notable and best tool
|
||||
|
||||
Alex Deckmyn
|
||||
<alex.deckmyn@gmail.com>
|
||||
Alex Deckmyn
|
||||
<alex.deckmyn@gmail.com>
|
||||
|
||||
# To build:
|
||||
|
||||
## Judges' comments:
|
||||
### To build:
|
||||
|
||||
make deckmyn
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
||||
### To run:
|
||||
|
||||
# A shell interpreter with proper backtick interpolation is required
|
||||
./deckmyn "`cat deckmyn.c`" "`cat musicfile.txt`" > sheetmusic.pbm
|
||||
A shell interpreter with proper backtick interpolation is required.
|
||||
|
||||
```sh
|
||||
./deckmyn "`cat deckmyn.c`" "`cat musicfile.txt`" > sheetmusic.pbm
|
||||
```
|
||||
|
||||
### Try:
|
||||
|
||||
./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm
|
||||
```sh
|
||||
./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm
|
||||
```
|
||||
|
||||
### Selected Judges Remarks:
|
||||
## Judges' comments:
|
||||
|
||||
The C of this entry is definitely sharp. The program cleverly uses its own
|
||||
source at runtime to define the notes, time signature and accidental bitmaps.
|
||||
@@ -31,19 +36,23 @@ Please use Bourne-family shells to run this entry.
|
||||
|
||||
## Author's comments:
|
||||
|
||||
Example use
|
||||
===========
|
||||
### Example use
|
||||
|
||||
You need the source code and example input (either one of the example files, or manual input as below) ready. And a program capable of showing .pbm bitmap format.
|
||||
|
||||
./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm
|
||||
display greensleeves.pbm
|
||||
```sh
|
||||
./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm
|
||||
open greensleeves.pbm
|
||||
```
|
||||
|
||||
./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm
|
||||
display short_bass.pbm
|
||||
```sh
|
||||
./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm
|
||||
open short_bass.pbm
|
||||
```
|
||||
|
||||
Description
|
||||
===========
|
||||
## Judges' comments:
|
||||
|
||||
### Description
|
||||
|
||||
Every major C competition should have an entry capable of producing C major.
|
||||
This is a music notation program. It produces bitmaps (.pbm) of music based on ASCII input. A full manual is added as a separate file. Some musical examples are also included.
|
||||
@@ -54,9 +63,7 @@ The program expects *two command line arguments*. The first is a (very long) str
|
||||
|
||||
The second command line argument is the music itself. This is, again, a string, not a file name. All music signs are entered as tokens of exactly 3 characters. The code is very sensitive to bad spacing! So for instance, if you use a file to write the music (e.g. example\_greensleeves), you should keep in mind that newline is also a character!
|
||||
|
||||
|
||||
Internals
|
||||
=========
|
||||
### Internals
|
||||
|
||||
To minimise the memory footprint, this program has *no variable declarations at all*, except for the arguments to main(). The only available memory space is from the command line arguments and count (argv and argc). Parts of argv are cast as integer when values under 0 or beyond 127 are expected.
|
||||
|
||||
@@ -64,9 +71,7 @@ The "music font" is defined by the source code itself. The first few lines are n
|
||||
|
||||
As there is no memory available, output is directly to stdout, byte by byte, from the top left to the bottom right pixel.
|
||||
|
||||
|
||||
LIMITATIONS
|
||||
===========
|
||||
### LIMITATIONS
|
||||
|
||||
The memory locations of argv are used for various purposes. Therefore, the program name (default "deckmyn") must be *at least 4 characters long*, including possibly the path. This, along with the ending '\0', gives minimum 5 bytes of useful memory space. Otherwise, the program may attempt to write outside the string.
|
||||
|
||||
@@ -76,9 +81,7 @@ The program has no special hardware limitations or requirements, other than 8bit
|
||||
|
||||
The limitations of using char as counters for e.g. the number of music staves are minor. 127 staves to a page is rather a lot.
|
||||
|
||||
|
||||
Obfuscations
|
||||
============
|
||||
### Obfuscations
|
||||
|
||||
The code has no declared variables other than the command line variables. Not even pointers (we all know how messy code can get with too many pointers!). As more than one variable needs values beyond 127, parts of the command line memory are cast as integer using a macro.
|
||||
|
||||
@@ -90,12 +93,10 @@ The code has no declared variables other than the command line variables. Not ev
|
||||
- The actual output of the music is done by one print command including a 800+ character nested conditional expression.
|
||||
- printf is also used for its return value.
|
||||
|
||||
## Copyright:
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
<!--
|
||||
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
||||
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
||||
|
||||
[judges]: http://www.ioccc.org/judges.html
|
||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
-->
|
||||
Reference in new issue
Block a user