Merge pull request #33 from xexyl/2014-vik
Point out minor bug in 2014/vik in years.html
This commit is contained in:
3 files changed
+48
-33
No files matched your search
+32
-22
@@ -8,28 +8,33 @@ Daniel Vik
|
|||||||
## Judges' comments:
|
## Judges' comments:
|
||||||
### To build:
|
### To build:
|
||||||
|
|
||||||
make
|
make all
|
||||||
|
|
||||||
### To run:
|
### To run:
|
||||||
|
|
||||||
./prog > foo.c
|
./prog > foo.c
|
||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
echo 'Want to hear me beep?' | ./prog > audio_file.raw
|
echo 'Want to hear me beep?' | ./prog > audio_file.raw
|
||||||
|
|
||||||
|
echo 'No. I want chocolate!' | ./prog | mplayer -demuxer rawaudio -
|
||||||
|
|
||||||
echo 'No. I want chocolate!' | ./prog | mplayer -demuxer rawaudio -
|
|
||||||
|
|
||||||
### Selected Judges Remarks:
|
### Selected Judges Remarks:
|
||||||
|
|
||||||
This program sets a new tone for obfuscation. But do you understand
|
This program sets a new tone for obfuscation. But do you understand
|
||||||
what it says about obfuscation? Perhaps:
|
what it says about obfuscation? Perhaps:
|
||||||
|
|
||||||
./prog < prog.c > prog.raw
|
|
||||||
|
|
||||||
might speak to your coding style? If not, then perhaps:
|
./prog < prog.c > prog.raw
|
||||||
|
|
||||||
|
|
||||||
|
might speak to your coding style? If not, then perhaps:
|
||||||
|
|
||||||
|
|
||||||
|
./prog < remarks.markdown | mplayer -demuxer rawaudio -
|
||||||
|
|
||||||
./prog < remarks.markdown | mplayer -demuxer rawaudio -
|
|
||||||
|
|
||||||
might help? :-)
|
might help? :-)
|
||||||
|
|
||||||
@@ -42,41 +47,46 @@ I can tell, there are at least six chocolate references in this program.
|
|||||||
This program can convert text to Morse to a raw 44.1kHz stereo audio file.
|
This program can convert text to Morse to a raw 44.1kHz stereo audio file.
|
||||||
Via streaming to mplayer, you can listen to the Morse audio.
|
Via streaming to mplayer, you can listen to the Morse audio.
|
||||||
|
|
||||||
Don't forget the last '-' as it makes mplayer read from stdin.)
|
Don't forget the last '-' as it makes mplayer read from stdin.
|
||||||
|
|
||||||
|
|
||||||
## Convert audio file with Morse signals to text
|
## Convert audio file with Morse signals to text
|
||||||
|
|
||||||
$ ./prog e < audio_file.raw
|
|
||||||
|
$ ./prog e < audio_file.raw
|
||||||
|
|
||||||
|
|
||||||
or alternatively pass a .wav file as input.
|
or alternatively pass a .wav file as input.
|
||||||
|
|
||||||
The preferred input format 44.1kHz stereo, but it does a decent job on mono
|
The preferred input format 44.1kHz stereo, but it does a decent job on mono
|
||||||
input and different frequencies as well.
|
input and different frequencies as well.
|
||||||
|
|
||||||
|
|
||||||
### Portability
|
### Portability
|
||||||
|
|
||||||
The program is portable to most platforms. The only system dependency is that
|
The program is portable to most platforms. The only system dependency is that
|
||||||
the program relies on writing binary data to stdout.
|
the program relies on writing binary data to stdout.
|
||||||
|
|
||||||
Microsoft compilers adds a carriage return to newlines, and to compile the
|
Microsoft compilers add a carriage return to newlines, and to compile the
|
||||||
program with this platform, the following line can be added after the main
|
program with this platform, the following line can be added after the main
|
||||||
declaration in order for the program to run correctly:
|
declaration in order for the program to run correctly:
|
||||||
|
|
||||||
_setmode(_fileno(stdout), 0x8000);
|
|
||||||
|
_setmode(_fileno(stdout), 0x8000);
|
||||||
|
|
||||||
### Known Issues
|
### Known Issues
|
||||||
|
|
||||||
The program uses a quite simple algorithm for detecting tone on and off events
|
The program uses a quite simple algorithm for detecting tone on and off events
|
||||||
in the Morse signal. Hence the program does not work well with noisy input
|
in the Morse signal. Hence the program does not work well with noisy input
|
||||||
signals. I have tested it with several samples of man made Morse recordings as
|
signals. I have tested it with several samples of man made Morse recordings as
|
||||||
well as computer generated ones.
|
well as computer generated ones.
|
||||||
|
|
||||||
Generally, any recording from ham radio transmissions does not decode due to
|
Generally, any recording from ham radio transmissions does not decode due to
|
||||||
noise and echoes. Other man made recordings may decode, but some characters
|
noise and echoes. Other man made recordings may decode, but some characters
|
||||||
can be incorrect due to too big variation in length of tones and pauses.
|
can be incorrect due to too big variation in length of tones and pauses.
|
||||||
However I found some man made recordings on that decode reasonable well.
|
However I found some man made recordings on that decode reasonable well.
|
||||||
|
|
||||||
If a recording don't decode, you could try to pre-process the input with a
|
If a recording doesn't decode, you could try to pre-process the input with a
|
||||||
narrow bandpass filter on the frequency of the transmission.
|
narrow bandpass filter on the frequency of the transmission.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
+12
-11
@@ -81,12 +81,12 @@ I will have more information on this entry at
|
|||||||
published.
|
published.
|
||||||
|
|
||||||
<a name="toc"></a>
|
<a name="toc"></a>
|
||||||
- [IOCCC: An Enigma?](#ioccc)
|
- [IOCCC: an Enigma?](#ioccc)
|
||||||
|
|
||||||
- [The 1992 Nathan entry](#nathan)
|
- [The 1992 Nathan entry](#nathan)
|
||||||
|
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
* [An example run](#example)
|
* [Example run](#example)
|
||||||
|
|
||||||
- [The recode.c configurator](#recode)
|
- [The recode.c configurator](#recode)
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ published.
|
|||||||
|
|
||||||
- [Resources](#resources)
|
- [Resources](#resources)
|
||||||
|
|
||||||
### <a name="ioccc" href="#toc">IOCCC: An Enigma?</a>
|
### <a name="ioccc" href="#toc">IOCCC: an Enigma?</a>
|
||||||
|
|
||||||
Is there a better single word that could describe the code that is IOCCC? I'm
|
Is there a better single word that could describe the code that is IOCCC? I'm
|
||||||
sure there are some other words that are equally as valid but I believe 'Enigma'
|
sure there are some other words that are equally as valid but I believe 'Enigma'
|
||||||
@@ -189,12 +189,13 @@ Finally it'll prompt you for the plugboard pairs.
|
|||||||
|
|
||||||
After that you can input the string and it'll go from there.
|
After that you can input the string and it'll go from there.
|
||||||
|
|
||||||
#### <a name="example" href="#toc">An example run</a>
|
#### <a name="example" href="#toc">Example run</a>
|
||||||
|
|
||||||
BTW: There's a much more entertaining (and delicious) challenge or exercise in
|
BTW: There's a much more entertaining (and delicious) challenge or exercise in
|
||||||
[recode.md][] (involves [chocolate-cake.html][]). These however show
|
[recode.md][] (involves [chocolate-cake.html][]) though one might need a different
|
||||||
the general program as well as how to use the two winning entries of the Morse
|
kind of exercise after taking up the challenge! :-) These however show the
|
||||||
code that I referred to earlier.
|
general program as well as how to use the two winning entries of the Morse code
|
||||||
|
that I referred to earlier:
|
||||||
|
|
||||||
|
|
||||||
$ ./prog -
|
$ ./prog -
|
||||||
@@ -228,21 +229,21 @@ Notice that all output except the deciphered/enciphered text is sent to stdout.
|
|||||||
If I didn't specify the `-` by e.g. `echo IOCCC | ./prog` then it will use the
|
If I didn't specify the `-` by e.g. `echo IOCCC | ./prog` then it will use the
|
||||||
default settings; as the judges suggest this invocation I will not show it here.
|
default settings; as the judges suggest this invocation I will not show it here.
|
||||||
|
|
||||||
You can also type it out like this though:
|
But you can also type it out like this:
|
||||||
|
|
||||||
$ ./prog
|
$ ./prog
|
||||||
IOCCC
|
IOCCC
|
||||||
UUMMX
|
UUMMX
|
||||||
|
|
||||||
|
|
||||||
The IOCCC comes from stdin; the UUMMX is stdout.
|
The IOCCC comes from stdin; the `UUMMX` is written to stdout.
|
||||||
|
|
||||||
If I compile the 2014 entry and copy it to my local directory as
|
If I compile the 2014 entry and copy it to my local directory as
|
||||||
`vik` I might do:
|
`vik` I might do:
|
||||||
|
|
||||||
$ echo TEST|./prog |./vik | mplayer -demuxer rawaudio -
|
$ echo TEST|./prog |./vik | mplayer -demuxer rawaudio -
|
||||||
|
|
||||||
And you would hear Morse code of the Enigma output of 'TEST' (i.e. KCWV). Or
|
And you would hear Morse code of the Enigma output of 'TEST' (i.e. `KCWV`). Or
|
||||||
perhaps not in this case. I'm not sure: I discovered a bug in that entry
|
perhaps not in this case. I'm not sure: I discovered a bug in that entry
|
||||||
(Fedora, CentOS and macOS all affected).
|
(Fedora, CentOS and macOS all affected).
|
||||||
|
|
||||||
@@ -289,7 +290,7 @@ Phew! The program redeemed itself after the test failure! :)
|
|||||||
|
|
||||||
(Technically above it didn't print a newline after the output and this is how it
|
(Technically above it didn't print a newline after the output and this is how it
|
||||||
is with some of the things I pasted in the other file and maybe others here
|
is with some of the things I pasted in the other file and maybe others here
|
||||||
too. Notice also how it showed the same output that my program gave it - UUMMX.)
|
too. Notice also how it showed the same output that my program gave it - `UUMMX`.)
|
||||||
|
|
||||||
What about the other Morse code entry?
|
What about the other Morse code entry?
|
||||||
|
|
||||||
|
|||||||
@@ -935,6 +935,10 @@ Contest </I></FONT></CENTER>
|
|||||||
<LI><A HREF="2014/vik/Makefile">Makefile</A>
|
<LI><A HREF="2014/vik/Makefile">Makefile</A>
|
||||||
<LI><A HREF="2014/vik/README.md">README.md</A>
|
<LI><A HREF="2014/vik/README.md">README.md</A>
|
||||||
<LI><A HREF="2014/vik/prog.c">prog.c</A>
|
<LI><A HREF="2014/vik/prog.c">prog.c</A>
|
||||||
|
<LI>A minor bug that shows up in some cases was found by
|
||||||
|
<a href="winners.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a>
|
||||||
|
when working on his <a href="#2020_ferguson2">2020 Enigma machine</a>. See his
|
||||||
|
README.md file for details (search for vik).
|
||||||
</UL>
|
</UL>
|
||||||
<A NAME="2014_wiedijk"></A>
|
<A NAME="2014_wiedijk"></A>
|
||||||
<P><B>wiedijk</B> - Y combinator</P>
|
<P><B>wiedijk</B> - Y combinator</P>
|
||||||
|
|||||||
Reference in new issue
Block a user