It's almost December and it's time for some festive fun.
Draw a xmas tree using ASCII art, as demonstrated below.
The input to the program will be a single command line argument indicating the order
Eg. xmastree 7
The judging will be based on the most elegant solution (whatever that means)
But presentation, comments, layout, etc will score big
Closing date: Midnight 7/12/2003 (GMT)Code:
Output the words to the 12 days of christmas
The program has no command line, nor any input
The judging will be based on the best obfuscation of the program.
The most obscure and convoluted program wins, providing it actually
produces the required output.
It you want to centre-align each line, you can if you want, but left-aligned text will also be fine.
Closing date: Midnight 14/12/2003 (GMT)
Santa has a lot of presents to put into his sleigh, and thus he needs
to optimise how the presents are packed to minimise the wasted space.
As he is very busy, he doesn't have a lot of time to come up with an answer.
The following list is a list of dimensions of xmas presents, which must be
placed into a 1 cubic metre box.
50 50 50
50 50 50
50 50 50
50 50 50
The boxes are a list of width, height and depth sizes (in centimetres).
This example fills the bottom half of the box with the 4 equally sized presents.
Write a program which fits the presents in the box.
Since orientation matters inside the box, the results consist of
- box number
- bottom-left-back corner (x,y,z)
- top-right-front corner (x,y,z)
The program accepts a single command line argument, which is the name
of the file containing the list of presents (one present per line).
Eg. xmasbox presentlist.txt
The calculation function pack_presents() should be clearly identifiable, as I will
be adding timing code around that function call. You can call it what you
want, but you need to indicate where I need to add the timing code.
Something like this is suggested.
The judging is solely on the time it takes pack_presents() to complete,Code:
/* START TIMER */
/* END TIMER */
so its generally in your interest to make it stick to the calculations only.
So make all your input and output separate functions.
There will be at most 20 presents to be fitted into the box.
Three separate tests will be performed, which will result in
- a partially filled box
- a completely filled box
- an overfilled box (choose most presents or least wasted space)
Closing date: Midnight 30/12/2003 (GMT)
All of these are to be written in ANSI-C or ANSI-C++ only (STL permitted for C++)
I'll be using gcc/Linux to compile and test code.
Submission details will follow shortly.