Solve hoppity first regardless of what you may have been told to do.
Follow these instructions carefully. The robot has zero tolerance for error.
Your program must be compatible with GCC 4.2. This compiler supports almost all of the C99 standard, so you can develop with other compilers as long as you avoid nonstandard functionality.
You must provide a makefile or antfile whose default target builds an executable named hoppity
, not hoppity.exe
. You can use mine if you put all of your code in hoppity.c
. To reuse my makefile for other puzzles, change the keyword.
On Windows, save your source code and make/antfile with no byte-order mark (BOM). In Notepad, select encoding “ANSI”. In Notepad++, select encoding “UTF-8 without BOM”. No action is required in editors intended specifically for programming.
Read from the file specified as argv[1]
, the first command-line argument. Open this file for reading only.
Write the unique correct sequence of bytes to the standard output stream (“the screen”) and terminate. Do not write to the standard error stream.
Attaching your source code and a make/antfile, send an email to 1051962371@fb.com
with subject hoppity
. Do not attach a digital signature.
You should receive a reply within an hour or so.
Whenever you use a standard symbol or type, include a header in which it is guaranteed to be declared. Do not expect the compiler to catch your omissions.
Do not include nonstandard headers like conio.h
and windows.h
.
Pass -std=gnu99
to make gcc
maximally permissive.
Pass -O2
to enable optimization.
If you call functions declared in <math.h>
, pass -lm
to link in the math library.
Enable all compiler warnings. Run valgrind if you suspect a subtle bug.
Do not use alloca()
or variable-length arrays. Use malloc()
instead.
© 2009–2011 David Eisenstat
part of An unofficial guide to the Facebook Engineering Puzzles