Menu

[Solved]Python Instant Insanity Array 6 Represents Opposite Pairs Index 0 Op1left Index 1 Op1right Q37118211

(PYTHON) Instant Insanity

Design a computer program to search for obstacles, if they exist, for Instant Insanity puzzles of size 30 cubes. If an obst

The array of 6 represents the opposite pairs. Index 0 = op1.leftIndex 1 = op1.right Index 2 = op2.left Index 3 = op2.right

The input should be

1 [4, 7, 10, 13, 16, 19]
2 [22, 26, 29, 2, 5, 8]
3 [11, 14, 18, 21, 24, 27]
4 [30, 3, 6, 10, 13, 16]
5 [19, 22, 25, 28, 2, 5]
6 [8, 11, 14, 17, 20, 24]
7 [27, 30, 3, 6, 9, 12]
8 [16, 11, 14, 17, 20, 24] and so on…

Can someone please help me to get started on this one? I don’tknow how to get those as my output.

Design a computer program to search for “obstacles,” if they exist, for Instant Insanity puzzles of size 30 cubes. If an obstacle exists find the smallest one. As mentioned in class, by obstacle I refer to a subset of the cubes, which cannot be part of any solution L.e., any stacking of these cubes entails at least one side having some color showing up two or more times. For instance if a given puzzle has two monochromatic cubes of the same color then that puzzle has an obstacle of size two. You have free reign over what type of algorithm to use, but I would prefer for you to write the program in Python as it will be easier for me to understand. Please turn in your source code along with your results. A brute-force algorithm (depth or breadth first search through the tree of possible selections) may work fine for puzzles without solutions of size less than 10 cubes. But in getting to size 30 the combinatorial explosion of possiblties may require some special considerations. Particularly insightful and efficient algorithm design may qualify for extra credit. Note that observing that a particular color only shows up three times is not the same as identifying the smallest obstacle. For this project we are looking for obstacles, not solving puzzles that have solutions. Of course it is possible (although unlikely) that one of the randomly built puzzles below actually has a solution. In that case, simply provide the solution As promised I am now supplying you with the data for the four puzzles that I will grade The routine I describe will fill in the colors in sequence: (cubel opposite pair 1 left, cube1 opposite pair 1 right, cube1 opposite pair 2 left, cube1 opposite pair 2 right, cube1 opposite pair 3 left, cubel opposite pair 3 right, cube2 opposite pair 1 left, cube2 opposite pair 1 right, cube2 opposite pair 2 left,… , cube30 opposite pair 3 left, cube30 opposite pair 3 right) The color-generating assignment formulae are 1 +((floor nt) mod 30), sns 180, for puzzle one, 1 +((floor ne) mod 30), sns 180, for puzzle two, 1 +(loor nv3) mod 30), 1sns180, for puzzle three 1 + ((floor nv5) mod 30), 1sns 180, for puzzle four Show transcribed image text Design a computer program to search for “obstacles,” if they exist, for Instant Insanity puzzles of size 30 cubes. If an obstacle exists find the smallest one. As mentioned in class, by obstacle I refer to a subset of the cubes, which cannot be part of any solution L.e., any stacking of these cubes entails at least one side having some color showing up two or more times. For instance if a given puzzle has two monochromatic cubes of the same color then that puzzle has an obstacle of size two. You have free reign over what type of algorithm to use, but I would prefer for you to write the program in Python as it will be easier for me to understand. Please turn in your source code along with your results. A brute-force algorithm (depth or breadth first search through the tree of possible selections) may work fine for puzzles without solutions of size less than 10 cubes. But in getting to size 30 the combinatorial explosion of possiblties may require some special considerations. Particularly insightful and efficient algorithm design may qualify for extra credit. Note that observing that a particular color only shows up three times is not the same as identifying the smallest obstacle. For this project we are looking for obstacles, not solving puzzles that have solutions. Of course it is possible (although unlikely) that one of the randomly built puzzles below actually has a solution. In that case, simply provide the solution As promised I am now supplying you with the data for the four puzzles that I will grade The routine I describe will fill in the colors in sequence: (cubel opposite pair 1 left, cube1 opposite pair 1 right, cube1 opposite pair 2 left, cube1 opposite pair 2 right, cube1 opposite pair 3 left, cubel opposite pair 3 right, cube2 opposite pair 1 left, cube2 opposite pair 1 right, cube2 opposite pair 2 left,… , cube30 opposite pair 3 left, cube30 opposite pair 3 right) The color-generating assignment formulae are 1 +((floor nt) mod 30), sns 180, for puzzle one, 1 +((floor ne) mod 30), sns 180, for puzzle two, 1 +(loor nv3) mod 30), 1sns180, for puzzle three 1 + ((floor nv5) mod 30), 1sns 180, for puzzle four

Expert Answer


Answer to (PYTHON) Instant Insanity The array of 6 represents the opposite pairs. Index 0 = op1.left Index 1 = op1.right Index 2 =… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *