Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Challenge: fastest program wins

Name: Anonymous 2009-04-14 12:59

Write a program in your language that
1.opens a file as arbitrary precision integer.
2.divides the number by 3.
3.stores the binary result in another file.

Name: Anonymous 2009-04-14 13:53


#define FUNCTION_RETURN_TYPE void
#define FUNCTION_NAME writeLoop
#define FUNCTION_PARAMETERS void
#define START_FUNCTION {
#define END_FUNCTION }
#define OPENING_DEVICE file
#define OPENING_FUNCTION open
#define WRITING_FUNCTION binaryWrite
#define FILE_OPEN_NAME someFile
#define FILE_WRITE_NAME anotherFile
#define MATH_OPERATION /
#define MATH_OPERATION_VALUE 3
#define NUMBER_OF_FILES 1
#define LOOP_INITIAL 0
#define INCREMENT += 1;
#define FOR_LOOP_BEGIN for
#define FOR_INITIALIZE_BEGIN (
#define FOR_INITIALIZE_END ;
#define FOR_CONDITION_BEGIN
#define FOR_CONDITION_END ;
#define FOR_INCREMENT_BEGIN
#define FOR_INCREMENT_END ) {
#define FOR_LOOP_END }
#define PARAMETERS_BEGIN (
#define PARAMETERS_END )
#define END_STATEMENT ;
#define INDEX_BEGIN [
#define INDEX_END ]
#define HEADERS #include <stdio.h> \
                #include <sys/stat.h> \
                #include <unistd.h> \
                #include <fcntl.h> \
                #include <stdlib.h>

HEADERS

typedef int arbitrary_precision_integer_t;

FUNCTION_RETURN_TYPE
FUNCTION_NAME
PARAMETERS_BEGIN
   FUNCTION_PARAMETERS
PARAMETERS_END
START_FUNCTION

int loopCount;
arbitrary_precision_integer_t arbitraryPrecisionIntegerFiles[NUMBER_OF_FILES];

FOR_LOOP_BEGIN
   FOR_INITIALIZE_BEGIN
      loopCount = LOOP_INITIAL;
   FOR_INITIALIZE_END
   FOR_CONDITION_BEGIN
      loopCount < NUMBER_OF_FILES
   FOR_CONDITION_END
   FOR_INCREMENT_BEGIN
      loopCount INCREMENT;
   FOR_INCREMENT_END
   loopCount = OPENING_DEVICE.OPENING_FUNCTION
               PARAMETERS_BEGIN
                  FILE_READ_NAME
                  O_RDONLY
               PARAMETERS_END
               END_STATEMENT
   OUTPUT_FILE = OPEN_DEVICE.OPENING_FUNCTION
                 PARAMETERS_BEGIN
                    FILE_WRITE_NAME,
                    O_WRONLY
                 PARAMETERS_END
                 END_STATEMENT
   OUTPUT_FILE.BINARY_WRITE
             PARAMETERS_BEGIN
                arbitraryPrecisionIntegerFiles
                   INDEX_BEGIN
                      loopCount
                   INDEX_END
             PARAMETERS_END
             END_STATEMENT
FOR_LOOP_END
END_FUNCTION


SCALABLE C

I will send it to the next department so they can implement ERROR CHECKING!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List