Build a Puzzle game in LINUX. (Ubuntu or Mint). You must use nCurses to complete the project.
Budget: $10 – $30 USD
PART 1-1:
1. Requirement:
This puzzle game has 15 number cards from 1 to 9 and A to F.
It has the nubmer cards in order from 1 to F.
It shuffles the number cards into arbitrary order.
The user moves the number cards one by one so that all the cards may be placed in order as first.
It counts how many steps the user moved the cards to the end.
The size of board is 4 (rows) X 4 (columns).
When the user places all the cards in order, the game is finished.
The user tries to make the less steps.
The game shows the current steps.
A user gets 1 step every step the user moves cards.
It should be colorful.
UP arrow key moves the card under the empty hole upward.
DOWN arrow key moves the card over the empty hole downward.
LEFT arrow key moves the card right to the empty hole to the left.
RIGHT arrow key moves the card left to the empty hole to the right.
Esc key stops the game.
F12 key shuffles the cards.
The shuffled cards should be possible to be sorted in order. Remember not all the shuffling ways make the cards possible to sort.
2. Hint:
Please read the website (https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/) in order to find all the information necessary to complete this assignment.
I shared the binary executable file Puzzle1-1. You can download it and run it on your linux system to see how your program should look like. You can think that it is kind of re-engineering but you can better understand the assignment and its user requirement. Note that you won't have any kind of feasible executable file or sample program from your customers in the real IT industry.
How to run it on Linux:
1) Go to the directory which you downloaded it to. Suppose that your login is linux and the directory is /home/linux/download. command in terminal as follows:
$ cd ~/download
2) Change its mode as follows:
$ chmod 777 Puzzle1-1
3) Run it as follows:
$ ./Puzzle1-2
PART 1-2:
Now,
I am happy to announce the assignment 1-2. The situation is that the client visisted you and asked you to add some functions to the original Puzzle game (Assignment 1-1), when you almost finished development of Assignment 1-1.
1. Additional Requirement:
This puzzle game has the self-solving fuction.
When It solves by itself, it counts negatively how many steps the program moved the cards to solve the shuffled puzzle, by reducing the value of STEPS.
The solving algorithm should optimize its solution at basic level.
You have to develop the solving algorithm by yourself. Don't search internet for it. I would regard your searching internet for puzzle solving algorithm as cheating.
When the program solves the puzzle, it shows its moving cards.
ENTER key let the program solve the puzzle.
While it is solving, if the user presses Esc key, it stops its solving immediately.
You can add more functions creatively.
3. Additional Hint:
I found that some students thought the shuffling algorithm too difficult for Assignment 1-1. But the suffling algorithm of Assignments 1-1 and 1-2 is not very difficult. It is neither AI (Artificial Inteligence) nor mathematical. Think how you would shuffle the puzzle and implement your thought way with coding. You need to perform domain analysis (= Number Puzzle game analysis). I shared the binary executable file Puzzle1-2. You can download it and run it on your linux system to see how your program should look like. You can think that it is kind of re-engineering but you can better understand the assignment and its user requirement. Note that you won't have any kind of feasible executable file or sample program from your customers in the real IT industry.
How to run it on Linux:
1) Go to the directory which you downloaded it to. Suppose that your login is
linux and the directory is /home/linux/download. command in terminal as
follows:
$ cd ~/download
2) Change its mode as follows:
$ chmod 777 Puzzle1-2
3) Run it as follows:
$ ./Puzzle1-2
DEADLINE IS 30 DECEMBER, 2021
1. Requirement:
This puzzle game has 15 number cards from 1 to 9 and A to F.
It has the nubmer cards in order from 1 to F.
It shuffles the number cards into arbitrary order.
The user moves the number cards one by one so that all the cards may be placed in order as first.
It counts how many steps the user moved the cards to the end.
The size of board is 4 (rows) X 4 (columns).
When the user places all the cards in order, the game is finished.
The user tries to make the less steps.
The game shows the current steps.
A user gets 1 step every step the user moves cards.
It should be colorful.
UP arrow key moves the card under the empty hole upward.
DOWN arrow key moves the card over the empty hole downward.
LEFT arrow key moves the card right to the empty hole to the left.
RIGHT arrow key moves the card left to the empty hole to the right.
Esc key stops the game.
F12 key shuffles the cards.
The shuffled cards should be possible to be sorted in order. Remember not all the shuffling ways make the cards possible to sort.
2. Hint:
Please read the website (https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/) in order to find all the information necessary to complete this assignment.
I shared the binary executable file Puzzle1-1. You can download it and run it on your linux system to see how your program should look like. You can think that it is kind of re-engineering but you can better understand the assignment and its user requirement. Note that you won't have any kind of feasible executable file or sample program from your customers in the real IT industry.
How to run it on Linux:
1) Go to the directory which you downloaded it to. Suppose that your login is linux and the directory is /home/linux/download. command in terminal as follows:
$ cd ~/download
2) Change its mode as follows:
$ chmod 777 Puzzle1-1
3) Run it as follows:
$ ./Puzzle1-2
PART 1-2:
Now,
I am happy to announce the assignment 1-2. The situation is that the client visisted you and asked you to add some functions to the original Puzzle game (Assignment 1-1), when you almost finished development of Assignment 1-1.
1. Additional Requirement:
This puzzle game has the self-solving fuction.
When It solves by itself, it counts negatively how many steps the program moved the cards to solve the shuffled puzzle, by reducing the value of STEPS.
The solving algorithm should optimize its solution at basic level.
You have to develop the solving algorithm by yourself. Don't search internet for it. I would regard your searching internet for puzzle solving algorithm as cheating.
When the program solves the puzzle, it shows its moving cards.
ENTER key let the program solve the puzzle.
While it is solving, if the user presses Esc key, it stops its solving immediately.
You can add more functions creatively.
3. Additional Hint:
I found that some students thought the shuffling algorithm too difficult for Assignment 1-1. But the suffling algorithm of Assignments 1-1 and 1-2 is not very difficult. It is neither AI (Artificial Inteligence) nor mathematical. Think how you would shuffle the puzzle and implement your thought way with coding. You need to perform domain analysis (= Number Puzzle game analysis). I shared the binary executable file Puzzle1-2. You can download it and run it on your linux system to see how your program should look like. You can think that it is kind of re-engineering but you can better understand the assignment and its user requirement. Note that you won't have any kind of feasible executable file or sample program from your customers in the real IT industry.
How to run it on Linux:
1) Go to the directory which you downloaded it to. Suppose that your login is
linux and the directory is /home/linux/download. command in terminal as
follows:
$ cd ~/download
2) Change its mode as follows:
$ chmod 777 Puzzle1-2
3) Run it as follows:
$ ./Puzzle1-2
DEADLINE IS 30 DECEMBER, 2021