Finalize the program in C (ANSI C / C89) - the game Shooting Stars (calculated minimum sequence of moves)
It is necessary to finish or refine a C program that already has initial code.
Important: There is no need to create a game with graphics or interactivity. The program should only calculate and output the minimum sequence of moves that leads to a winning configuration.
Main requirements:
- Language and standard: ANSI C / C89
- Compilation: gcc -std=c90 -Wall -Wpedantic file.c -o file -lm
The program should not produce errors or warnings.
- Functionality:
Takes one command line argument — a file with the initial configuration (3x3 characters: * = star, . = black hole).
Outputs the minimum sequence of moves for a winning configuration:
***
*.*
***
Cells are numbered:
0 1 2
3 4 5
6 7 8
If a win is impossible — outputs -1.
If the configuration is already winning — outputs nothing.
- Data structures:
Use lists, stack, or queue through nodes and pointers (not arrays).
- Memory:
Allocated memory through malloc must be freed through free().
Check with Valgrind.
- Other requirements:
The program does not interact with the user, does not use temporary files.
Comments in the code are desirable for clarity.
The program should be efficient and understandable.
- Initial code:
The code will be provided after agreement with the performer.
Payment:
Can be agreed upon after assessing the complexity.
If possible, payment via PayPal.
-
Hello, I am ready to fulfill your technical task. My first programming language that I learned is C. I am ready to fix errors. Please write to collaborate.
-
1142 7 0 Good day, I need to study your code in more detail, please write.