Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this coded in the language of C Given the 15 puzzle https:l/en.wikipedia.org/wiki/15_puzzle You should write a program to manipulate it (not to solve

I need this coded in the language of C

image text in transcribed

Given the 15 puzzle https:l/en.wikipedia.org/wiki/15_puzzle You should write a program to manipulate it (not to solve it just manipulate it). Your program should be able to get commands from the user, the commands are to move the space up (u), down (d), left (1), or right (r). then your program should move the space and display the puzzle. Part 1 In this part, just write the program to read and display the array Reading the input The input is on the form of a pair of integers (i.j), then 15 digits (1..15). the i,j pair indicates where is the space. Then the 15 numbers fill the array with the numbers 1 to 15. For example if the input 2,2 79 115 26 8 311 4 10 5 14 13 12 the array is 7 91 15 11 4 10 5 14 13 12 Which is a 4x4 array with element (2,2) empty space. Display the array The array should ne displayes as above (without the square brackets of course) For ease of marking you should print the numbers in the matrix as printf ("%-4d" ,a [i] [j] ) ; and the empty space as printf("") where there are 4 spaces between the two quotation marks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

How will the members be held accountable?

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago