caml programming    1. Create a type slidingTile, consisting of a char matrix and two integers x and y. The integers x and y are the coordinates of an empty tile. 2. Create a function val slide : slidingTile -> int -> int -> slidingTile = that given a slidingTile and two integers, that represent a location in the matrix, it slides the tile from the speci ed location to the empty tile, then returns the altered slidingTile. If provided location is not adjacent to the empty tile, or out of bounds, then return the slidingTile unaltered. 3. Create a function val print_tile : slidingTile -> unit = that prints a slidingTile on screen with the corresponding characters from the matrix. However, print an empty space where the empty tile is instead.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 2E
icon
Related questions
Question

Ocaml programming 

 

1. Create a type slidingTile, consisting of a char matrix and two integers x
and y. The integers x and y are the coordinates of an empty tile.


2. Create a function


val slide : slidingTile -> int -> int -> slidingTile = <fun>


that given a slidingTile and two integers, that represent a location in the
matrix, it slides the tile from the speci ed location to the empty tile, then
returns the altered slidingTile. If provided location is not adjacent to the
empty tile, or out of bounds, then return the slidingTile unaltered.


3. Create a function


val print_tile : slidingTile -> unit = <fun>


that prints a slidingTile on screen with the corresponding characters from
the matrix. However, print an empty space where the empty tile is instead.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr