Animal puzzle, Game Theory

a) This you just have to list all the attributes for the program. i.e. unique id's for puzzle pieces, attributes for the puzzle like a data field for the number of edges, methods that you will use on the puzzle pieces like a rotate method, boolean attributes for tracking which pieces have been used/checked. we also had an array to store the edges in that match the current pieces edges

b) in here we talked about the notation to represent the puzzle piece. I see you have shapes with pictures of pigs on them You will need to have a notation that describes each side i.e. the orientation of the pig, the colour and whether it is a head or tail you could use - T, R, L (a Tail which is red and is pointed left) Therefore a shape could be described by combining 3 of these for a triangle or 8 for the octagon. there are several alternatives to this we figured out the total possible number of different edges i.e. how many different combinatiosn of colour, end/head and orientation there could be (think it was 16) and assigned numbers to them. so 1-8 was for all the heads of different colours and different orientations and then -1 to -8 was for the tails of the same colour and orientation. this was good because when two edges matched adding their number would equal 0 and we would know they matched. we also found it necessary to have a data structure for the pattern that the pieces would form we called this 'slot' and this was used to show connections between pieces that were required to form the final structure.  

c) This is simply formalising the data structure you created in part b. using the data structure for a write a file that can represent a set of pieces. think about whether you want it to all be on one line or be seperated by piece. you need to write it out like you will feed it into the program d) Are you going to use brute force? or is there a more effectient way to do it? For ours we had an array where each index had a piece and that piece had to match with several other indexes piece by matching sides to make the shape. We did this by comparing sides to see if they matched, if they didnt we rotated the piece and checked again, we did this over and over until we found a solution or had checked every piece in every postion in every rotation

our total routine was to initialise variables, i.e. read in the file with piece info, construct a list of possible matches for each edge on each piece then the last step was to match these up and see if the fitted in the slot pattern

Posted Date: 4/6/2013 2:35:12 AM | Location : United States







Related Discussions:- Animal puzzle, Assignment Help, Ask Question on Animal puzzle, Get Answer, Expert's Help, Animal puzzle Discussions

Write discussion on Animal puzzle
Your posts are moderated
Related Questions
a) Define the term Nash equilibrium b) You are given the following pay-off matrix:   Strategies for player 1   Strategies for player 2

A type of sequential second worth auction, just like an English auction during which an auctioneer frequently raises the present worth. Participants should signal at each worth lev

Exercise 1 a) Pure strategy nash equilibrium in this case is Not Buy, bad ( 0,0) as no one wants to deviate from this strategy. b) The player chooses buy in the first perio

A multiunit auction mechanism for assigning heterogeneous (different) objects. The highest bidder in the first round selects one item among those offered for sale. Then, a second r

This version of Twenty-one is a card game played between a player and the dealer (the computer). The aim of the game is to accumulate a higher point total than the dealer but witho

Consider a game in which player 1 chooses rows, player 2 chooses columns and player 3 chooses matrices. Only Player 3''s payoffs are given below. Show that D is not a best response

I have an assignment in which I have to invent a new international trade theory. For me, the absolute advantage of Adam Smith is really good, and I want to find a solution if a cou

Consider the electoral competition game presented in Lecture 6. In this game there are two candidates who simultaneously choose policies from the real line. There is a distribution

scenario A wife and husband ready to meet this evening, but cannot remember if they will be attending the opera or a boxing match. Husband prefers the boxing match and wife pref

Consider the situation in which Player M is an INCUMBENT monopolist in an industry, which makes a profit of $10m if left to enjoy its privileged position undisturbed. Player P is a