Question: Can I get the expected input for the java Unlock test case in the first picture? due Monday, February 1, midnight In this assignment, you

 Can I get the expected input for the java "Unlock testcase" in the first picture? due Monday, February 1, midnight In this

Can I get the expected input for the java "Unlock test case" in the first picture?

due Monday, February 1, midnight In this assignment, you will implement an ADT for a hexagonal coordinate system for creating games that operate on hexagon-tile boards. You will also implement a simple "enumerated class" for various kinds of terrains. 1 ADT: Hex Coordinate For this homework, you are creating an immutable data type to represent hexagon coordi- nates. Each coordinate represents the center of a hexagon in a tiling of the plane: 0,0.0 1.0.1 2.0,2 3.0.3 4.0,4 1,1,0 2,1,1 3,1,2 4,1,3 1.2.-1 2,2,0 3,2,1 4,2,2 5,2,3 2,3,-1 3,3,0 4,3,1 5,3,2 Each hexagon has three coordinates: the first increases as you go to the right and down), the second as you go down, the third as you go right (and up). In the electronic version of this document, you can see that a band of hexagons with first coordinate equal to two have been highlighted in yellow. If you have a paper copy of this document, we recommend that you highlight in three contrasting colors bands of hexagons with the same coordinate equal to two. (There are a number of different hexagonal grids used in practice, but you should use thisone for this homework.) The third coordinate can always be computed from the other two For example, if you know a and b, you can subtract one from the other to get c, as you can see in the diagram. We therefore often use just the first two numbers to create a coordinate. Two hexagonal coordinates are equal exactly when they have the same numbers in the same order. The "distance from one hex coordinate is the minimum number of moves to adjacent hexagons needed to get from one to another. Thus the distance from (3,0, 3) to (5,2,3) is 1 Unsurprisingly, given that this is a two dimensional grid. Unlock Test Case public void test() { HexCoordinate h = new HexCoordinate(2,1); assertEquals(???, h.toString(); III String Check Cancel public void test() { HexCoordinate h = new HexCoordinate( a: 2, b: 1); assertEquals(Ts( i: 572530722), h.toString()); // Look at the picture on the first page: assertEquals(Ti( i: 2091651564),h.distance(new HexCoordinate(-a assertEquals(Ti( i: 83653195), h. distance(n)); assertEquals(Ti( i: 330722134), h.distance(new HexCoordinate( a: // no sqrt(3) stuff for this one: assertEquals(Ti( i: 832991396), h.toPoint( width: 1000).x); // NB: sqrt(3)/2 = 0.8660... // And look at the homework page 2 assertEquals(Ti( i: 542975482), h.toPoint( width: 1000).y); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!