Explore Historic Mazes

Choose a maze on the first screen. Next screen shows chosen maze at ground level, with arrows to move. FRom there you can get information on the maze, or a bird's eye view.

Stringsapp/res/values/strings.xml
Menu screen formatapp/res/layout/activity_main.xml
Stylesapp/res/values/styles.xml
Code for appapp/java/com.(the project name)/MainActivity
Explore maze screen formatapp/res/layout/explore.xml
Code for Explore mazeapp/java/com.(the project name)/Explore
Code for explore gridviewapp/java/com.(the project name)/ImageExplore
Birdseye screen formatapp/res/layout/birdseye.xml
Code for bird's eye viewapp/java/com.(the project name)/Birdseye
Code for birdseye gridviewapp/java/com.(the project name)/ImageBirdseye
Information screen formatapp/res/layout/information.xml
Code for Informationapp/java/com.(the project name)/Ifrmation



app/manifests/AndroidManifest.xml - to force orientation and provide multiple screens

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.edkins.mazes" > <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Explore" android:screenOrientation="portrait" android:label="@string/exploreText" android:theme="@style/AppTheme" > <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.edkins.mazes.MainActivity" /> </activity> <activity android:name=".BirdsEye" android:screenOrientation="portrait" android:label="@string/birdsEyeText" android:theme="@style/AppTheme" > <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.edkins.mazes.Explore" /> </activity> <activity android:name=".Information" android:screenOrientation="portrait" android:label="@string/infoText" android:theme="@style/AppTheme" > <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.edkins.mazes.Explore" /> </activity> </application> </manifest>


app/res/drawable - pictures

Parts of the maze (hedge, path, sky, where these meet, arrows, etc. Icons for bird's eye view, information and finger pointing backwards.




app/res/mipmap/ic_launcher.png/ - icon for launching app




app/res/values/strings.xml - strings

<resources> <string name="app_name">Mazes</string> <string name="howTo1">"Tap on name to choose maze"</string> <string name="howTo2">"Tap on arrow"</string> <string name="finish">"You have reached the centre of the maze!"</string> <string name="start1">"You have returned to the entrance."</string> <string name="start2">"You have reached the other entrance."</string> <string name="mazeText">"Maze index"</string> <string name="exploreText">"Explore the maze"</string> <string name="birdsEyeText">"Birdseye view of maze"</string> <string name="infoText">"Information about maze"</string> <string name="appText">"Information about app"</string> <string name="location">"Distance travelled "</string> <string name="facing">" Facing "</string> <string name="restart">Restart</string> <string name="newMaze">New Maze</string> <string name="maze1Text">Hampton Court (original)</string> <string name="maze2Text">Hampton Court (current)</string> <string name="maze3Text">Chevening House</string> <string name="maze4Text">Hatfield House (entrance 1)</string> <string name="maze5Text">Hatfield House (entrance 2)</string> <string name="maze6Text">Bridge End</string> <string name="maze7Text">Egeskov Castle</string> <string name="mazeInfo">Chose a maze. You can then explore the maze as if you were inside the maze (rather than seeing it from above).\n Click on the arrows to choose where to go.\nClick on the eye icon to see a bird\'s eye view (from above).\nClick on the book icon for information about the maze.\n\nThe mazes are not to scale and the directions are not necessarily correct, but the turns and branches are accurate.\n\nYou will find at times that you appear to be walking down a long corridor and nothing is happening. Be patient! Carry on, and eventually a turning will appear.</string> <string name="maze1Info">Hampton Court is a Tudor palace near London, once owned by Henry VIII. In its grounds is a famous maze.\n\n It is Britain\'s oldest surviving hedge maze, and the oldest hedge maze in the world in continuous use.\n\nThe maze was designed by George London and Henry Wise in 1690. It was originally planted with hornbeam, but is now made of yew.\n\nYou can get to the centre of this maze by choosing at junctions always to turn left (or straight on if left is not available). It will also work if you always choose right. It is not the quickest path, though!</string> <string name="maze2Info">The Hampton Court maze was designed in 1690 and a diagram of that design survives. The current design is slightly changed. There are three gaps in the hedge walls which were not in the original design.\n\nThat means that if you use a map of the original design to walk the modern maze, you will get lost!\n\nThe gaps may have been made when some of the yew trees making the hedge walls died and were not replaced.\n\nYou can get to the centre of this maze by choosing at junctions always to turn left (or straight on if left is not available). It will also work if you always choose right. It is not the quickest path, though!</string> <string name="maze3Info">Chevening House, in Kent, is an official residence of Her Britannic Majesty\'s Principal Secretary of State for Foreign and Commonwealth Affairs.\n\nBetween 1818 and 1830 the 4th Earl of Stanthorpe planted a yew hedge maze at Chevening House to a design by the 2nd Earl, a famous mathematician of his day.\n\nSome mazes can be solved by always taking the first right (or left) turning. This maze cannot be solved in this way, as eventually you return to the entrance without ever finding the centre.</string> <string name="maze4Info">Hatfield House is in Hertfordshire. It was built by Robert Cecil, 1st Earl of Salisbury, in 1611.\n\nThe yew maze at Hatfield House was planted in 1840.\n\nThere are two entrances to this maze. You can walk from one entrance to the other via the centre. This starts you at the first entrance.\n\nYou can get to the centre of this maze by choosing at junctions always to turn left (or straight on if left is not available). It will also work if you always choose right. It is not the quickest path, though!</string> <string name="maze5Info">Hatfield House is in Hertfordshire. It was built by Robert Cecil, 1st Earl of Salisbury, in 1611.\n\nThe yew maze at Hatfield House was planted in 1840.\n\nThere are two entrances to this maze. You can walk from one entrance to the other via the centre. This starts you at the second entrance.\n\nYou can get to the centre of this maze by choosing at junctions always to turn left (or straight on if left is not available). It will also work if you always choose right. It is not the quickest path, though!</string> <string name="maze6Info">Bridge End Garden is in Saffon Walden, Essex. It is a series of seven interlinked gardens laid out by the Gibson family in the nineteenth century.\n\nThe hedge maze was planted around 1870 and restored in 1986. It is made of yew hedges.\n\nThe maze is an odd shape. This version has been changed into a rectangle.\n\nYou can get to the centre of this maze by choosing at junctions always to turn left (or straight on if left is not available). It will also work if you always choose right. It is not the quickest path, though!</string> <string name="maze7Info">Egeskov Castle is in Denmark. It was built in 1554.\n\nThere are several mazes in the grounds. The oldest one was created in the nineteenth century, and is made of beech. It is closed to the public to preserve it. However, you can explore it in this app! This is a simplified version of the maze.\n\nThere is a short path and a long path to the centre, and you can reach the centre from two different directions. It is possible to walk through the centre to carry on exploring the maze.\n\nSome mazes can be solved by always taking the first right (or left) turning. This maze cannot be solved in this way, as eventually you return to the entrance without ever finding the centre.</string> </resources>


app/res/layout/activity_main.xml - menu screen format

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> <ImageView android:id="@+id/infoPic" android:src="@drawable/info" android:onClick="doInformation" android:layout_width="100dp" android:layout_height="50dp" android:contentDescription="@string/appText" android:paddingBottom="@dimen/activity_vertical_margin" /> <TextView android:id="@+id/howTo1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/howTo1" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:layout_toRightOf="@id/infoPic" android:layout_toEndOf="@id/infoPic" /> <TextView android:id="@+id/maze1" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze1Text" android:onClick="doMaze1" android:layout_below="@id/howTo1" /> <TextView android:id="@+id/maze2" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze2Text" android:onClick="doMaze2" android:layout_below="@id/maze1" /> <TextView android:id="@+id/maze3" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze3Text" android:onClick="doMaze3" android:layout_below="@id/maze2" /> <TextView android:id="@+id/maze4" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze4Text" android:onClick="doMaze4" android:layout_below="@id/maze3" /> <TextView android:id="@+id/maze5" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze5Text" android:onClick="doMaze5" android:layout_below="@id/maze4" /> <TextView android:id="@+id/maze6" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze6Text" android:onClick="doMaze6" android:layout_below="@id/maze5" /> <TextView android:id="@+id/maze7" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:text="@string/maze7Text" android:onClick="doMaze7" android:layout_below="@id/maze6" /> </RelativeLayout>


app/res/values/styles.xml - styles

<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <style name="MenuTheme"> <item name="android:textColor">#600</item> <item name="android:textSize">20sp</item> <item name="android:textStyle">bold</item> </style> </resources>


app/java/com.(the project name)/MainActivity - main code for app

package com.edkins.mazes; import android.content.Intent; import android.content.res.Resources; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCompatActivity { public static Integer[][] maze; public static Integer[] exploreMaze = new Integer [49]; public static String name = " "; public static String info = " "; public static String[] face; public static int wide = 0; public static int deep = 0; public static int startx = 0; public static int starty = 0; public static int startDirection = 0; public static int manx = 0; public static int many = 0; public static int direction = 0; public static int distance = 0; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Resources res = getResources(); face = res.getStringArray(R.array.directions); } public void doMaze1(View view) { name = getString(R.string.maze1Text); info = getString(R.string.maze1Info); wide = 25; deep = 33; startx = 1; starty = 15; startDirection = 0; maze = new Integer[][]{ {2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2}, {2,2,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,2,2}, {2,2,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,2,2}, {2,2,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,2,2}, {2,2,1,0,1,0,1,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, {2,2,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,2,2}, {2,2,1,0,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,2,2}, {2,2,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,2,2}, {2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2}, }; goExplore(); } public void doMaze2(View view) { name = getString(R.string.maze2Text); info = getString(R.string.maze2Info); wide = 25; deep = 33; startx = 1; starty = 15; startDirection = 0; maze = new Integer[][]{ {2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2}, {2,2,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,2,2}, {2,2,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,2,2}, {2,2,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,2,2}, {2,2,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,2,2}, {2,2,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1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,1,0,1,1,1,0,1,0,1,2,2}, {2,2,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,2,2}, {2,2,1,0,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,2,2}, {2,2,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,2,2}, {2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2}, }; goExplore(); } public void doMaze3(View view) { name = getString(R.string.maze3Text); info = getString(R.string.maze3Info); wide = 43; deep = 45; startx = 21; starty = 43; startDirection = 3; maze = new Integer[][]{ {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1}, {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1}, {1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1}, {1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1}, {1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1}, {1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,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1,1,1,1,1,1,1}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, }; goExplore(); } public void doMaze4(View view) { name = getString(R.string.maze4Text); info = getString(R.string.maze4Info); wide = 37; deep = 49; startx = 18;starty = 1; startDirection = 1; maze = new Integer[][]{ {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2}, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}, {2,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2}, {2,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}, {2,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,2}, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,2}, {2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,2}, {2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0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,1,1,1,0,1,0,1,0,1,0,1,2}, {2,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,2}, {2,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,2}, {2,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,2}, {2,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,2}, {2,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,2}, {2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,2}, {2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,2}, {2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,2}, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}, {2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, }; goExplore(); } public void doMaze5(View view) { name = getString(R.string.maze5Text); info = getString(R.string.maze5Info); wide = 37; deep = 49; startx = 18; starty = 47; startDirection = 3; maze =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1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,2}, {2,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,2}, {2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,2}, {2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,2}, {2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,2}, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}, {2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, }; goExplore(); } public void doMaze6(View view) { name = getString(R.string.maze6Text); info = getString(R.string.maze6Info); wide = 27; deep = 34; startx = 13; starty = 32; startDirection = 3; maze = new Integer[][]{ {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2}, {2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2}, {2,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0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,2,2,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,2,2,2,2}, {2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,2,2,2,2}, {2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,2,2,2,2}, {2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2}, {2,2,2,2,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, }; goExplore(); } public void doMaze7(View view) { name = getString(R.string.maze7Text); info = getString(R.string.maze7Info); wide = 31; deep = 39; startx = 3; starty = 19; startDirection = 0; maze = new Integer[][]{ {2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2}, {2,2,2,2,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2}, {2,2,2,2,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,2,2,2,2}, {2,2,2,2,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,2,2,2,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2}, {2,2,2,2,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,2,2,2,2}, {2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2}, }; goExplore(); } public void goExplore() { manx = startx; many = starty; direction = startDirection; distance = 0; Intent intent = new Intent(this,Explore.class); startActivity(intent); } public void doInformation(View view) { info = getString(R.string.mazeInfo); Intent intent = new Intent(this,Information.class); startActivity(intent); } }


app/res/layout/explore.xml - explore maze screen format

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Explore"> <ImageView android:id="@+id/birdseyePic" android:src="@drawable/birdseye" android:onClick="doBirdsEye" android:layout_width="100dp" android:layout_height="50dp" android:contentDescription="@string/birdsEyeText" /> <TextView android:id="@+id/exploreName" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/MenuTheme" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:layout_toRightOf="@id/birdseyePic" android:layout_toEndOf="@id/birdseyePic" /> <TextView android:id="@+id/howTo2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/howTo2" android:layout_centerHorizontal="true" android:layout_below="@id/birdseyePic" /> <TextView android:id="@+id/distanceText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/location" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:layout_below="@id/howTo2" /> <TextView android:id="@+id/distanceContent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:layout_below="@id/howTo2" android:layout_toRightOf="@id/distanceText" android:layout_toEndOf="@id/distanceText" /> <TextView android:id="@+id/directionText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/facing" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:layout_below="@id/howTo2" android:layout_toRightOf="@id/distanceContent" android:layout_toEndOf="@id/distanceContent" /> <TextView android:id="@+id/directionContent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:layout_below="@id/howTo2" android:layout_toRightOf="@id/directionText" android:layout_toEndOf="@id/directionText" /> <GridView android:id="@+id/exploreView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:numColumns="7" android:layout_below="@id/distanceText" /> <ImageView android:id="@+id/infoPic" android:src="@drawable/info" android:onClick="doInformation" android:layout_width="100dp" android:layout_height="50dp" android:contentDescription="@string/infoText" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:layout_below="@id/exploreView" /> <Button android:id="@+id/restartButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/restart" android:onClick="doRestart" android:layout_below="@id/exploreView" android:layout_toRightOf="@id/infoPic" android:layout_toEndOf="@id/infoPic" /> <Button android:id="@+id/backPic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/newMaze" android:onClick="doBack" android:layout_below="@id/exploreView" android:layout_toRightOf="@id/restartButton" android:layout_toEndOf="@id/restartButton" /> </RelativeLayout>


app/java/com.(the project name)/Explore - code for explore maze screen

package com.edkins.mazes; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.GridView; import android.widget.TextView; import android.widget.Toast; public class Explore extends AppCompatActivity { public static int nextx1; public static int nexty1; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.explore); TextView output = (TextView) findViewById(R.id.exploreName); output.setText(MainActivity.name); setup(); GridView exploreV = (GridView) findViewById(R.id.exploreView); exploreV.setAdapter(new ImageExplore(this)); exploreV.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { processExplore(position); } }); } public void setup() { TextView topView = (TextView) findViewById(R.id.howTo2); topView.setText(getString(R.string.howTo2)); TextView dist = (TextView) findViewById(R.id.distanceContent); String str = MainActivity.distance + ""; dist.setText(str); TextView dir = (TextView) findViewById(R.id.directionContent); dir.setText(MainActivity.face[MainActivity.direction]); int xi; int yi; int xl; int yl; int xr; int yr; if (MainActivity.direction == 0) {xi = 1; yi = 0; xl = 0; yl = -1; xr = 0; yr = 1;} else if (MainActivity.direction == 1) {xi = 0; yi = 1; xl = 1; yl = 0; xr = -1; yr = 0;} else if (MainActivity.direction == 2) {xi = -1; yi = 0; xl = 0; yl = 1; xr = 0; yr = -1;} else {xi = 0; yi = -1; xl = -1; yl = 0; xr = 1; yr = 0;} for (int i=0;i<49;i++) {MainActivity.exploreMaze[i] = R.drawable.hedge;} for (int i=1;i<=5;i++) {MainActivity.exploreMaze[i] = R.drawable.sky;} for (int i=43;i<=47;i++) {MainActivity.exploreMaze[i] = R.drawable.path;} int newx = MainActivity.manx; int newy = MainActivity.many; if (MainActivity.maze[newy - yi][newx - xi]==0) {MainActivity.exploreMaze[45] = R.drawable.down;} if (MainActivity.maze[newy + yl][newx + xl]==0) { MainActivity.exploreMaze[0] = R.drawable.sky; for (int i=1;i<7;i++) {MainActivity.exploreMaze[i*7] = R.drawable.hedgegapleft;} MainActivity.exploreMaze[42] = R.drawable.leftgrey; } else { MainActivity.exploreMaze[0] = R.drawable.skyleft; MainActivity.exploreMaze[42] = R.drawable.pathleft; } if (MainActivity.maze[newy + yr][newx + xr]==0) { MainActivity.exploreMaze[6] = R.drawable.sky; for (int i=2;i<8;i++) {MainActivity.exploreMaze[i*7-1] = R.drawable.hedgegapright;} MainActivity.exploreMaze[48] = R.drawable.rightgrey; } else { MainActivity.exploreMaze[6] = R.drawable.skyright; MainActivity.exploreMaze[48] = R.drawable.pathright; } if (MainActivity.maze[newy + yi][newx + xi]==1 || MainActivity.maze[newy + yi][newx + xi]==2) { return; } MainActivity.exploreMaze[8] = R.drawable.skyleft; for (int i=9;i<=11;i++) {MainActivity.exploreMaze[i] = R.drawable.sky;} MainActivity.exploreMaze[12] = R.drawable.skyright; MainActivity.exploreMaze[16] = R.drawable.skyleft; MainActivity.exploreMaze[17] = R.drawable.sky; MainActivity.exploreMaze[18] = R.drawable.skyright; MainActivity.exploreMaze[36] = R.drawable.pathleft; for (int i=37;i<=39;i++) {MainActivity.exploreMaze[i] = R.drawable.path;} MainActivity.exploreMaze[40] = R.drawable.pathright; MainActivity.exploreMaze[30] = R.drawable.pathleft; MainActivity.exploreMaze[31] = R.drawable.path; MainActivity.exploreMaze[32] = R.drawable.pathright; nextx1 = newx + 2*xi; nexty1 = newy + 2*yi; if (MainActivity.maze[nexty1 + yl][nextx1 + xl]==0) { MainActivity.exploreMaze[16] = R.drawable.sky; MainActivity.exploreMaze[23] = R.drawable.hedgegapleft; MainActivity.exploreMaze[30] = R.drawable.left; } else { MainActivity.exploreMaze[16] = R.drawable.skyleft; MainActivity.exploreMaze[30] = R.drawable.pathleft; } if (MainActivity.maze[nexty1 + yr][nextx1 + xr]==0) { MainActivity.exploreMaze[18] = R.drawable.sky; MainActivity.exploreMaze[25] = R.drawable.hedgegapright; MainActivity.exploreMaze[32] = R.drawable.right; } else { MainActivity.exploreMaze[18] = R.drawable.skyright; MainActivity.exploreMaze[32] = R.drawable.pathright; } if (MainActivity.maze[nexty1 + yi][nextx1 + xi]==1) {return;} else if (MainActivity.maze[nexty1 + yi][nextx1 + xi]==2) { MainActivity.exploreMaze[24] = R.drawable.outside; if (MainActivity.starty==(nexty1) && MainActivity.startx==(nextx1)) { topView.setText(getString(R.string.start1)); } else {topView.setText(getString(R.string.start2));} return; } else if (MainActivity.maze[nexty1 + yi][nextx1 + xi]==0) {MainActivity.exploreMaze[31] = R.drawable.up;} else if (MainActivity.maze[nexty1 + yi][nextx1 + xi]==3) { MainActivity.exploreMaze[31] = R.drawable.upcentre; topView.setText(getString(R.string.finish)); } MainActivity.exploreMaze[24] = R.drawable.middle; } public void processExplore(int position) { if (position==45 && MainActivity.exploreMaze[45]==R.drawable.down) { MainActivity.direction = (MainActivity.direction + 2) % 4; setup(); redo(); return; } if (position==42 && MainActivity.exploreMaze[42]==R.drawable.leftgrey) { MainActivity.direction = (MainActivity.direction + 3) % 4; setup(); redo(); return; } if (position==48 && MainActivity.exploreMaze[48]==R.drawable.rightgrey) { MainActivity.direction = (MainActivity.direction + 1) % 4; setup(); redo(); return; } if (position==31 && (MainActivity.exploreMaze[31]==R.drawable.up || MainActivity.exploreMaze[31]==R.drawable.upcentre)) { MainActivity.manx = nextx1; MainActivity.many = nexty1; MainActivity.distance++; setup(); redo(); return; } if (position==30 && MainActivity.exploreMaze[30]==R.drawable.left) { MainActivity.manx = nextx1; MainActivity.many = nexty1; MainActivity.distance++; MainActivity.direction = (MainActivity.direction + 3) % 4; setup(); redo(); return; } if (position==32 && MainActivity.exploreMaze[32]==R.drawable.right) { MainActivity.manx = nextx1; MainActivity.many = nexty1; MainActivity.distance++; MainActivity.direction = (MainActivity.direction + 1) % 4; setup(); redo(); return; } Toast.makeText(getApplicationContext(), getString(R.string.howTo2), Toast.LENGTH_SHORT).show(); } public void redo() { GridView exploreV = (GridView) findViewById(R.id.exploreView); exploreV.setAdapter(new ImageExplore(this)); } public void doBack(View view) { Intent intent = new Intent(this, MainActivity.class); startActivity(intent); } public void doBirdsEye(View view) { Intent intent = new Intent(this, BirdsEye.class); startActivity(intent); } public void doInformation(View view) { Intent intent = new Intent(this, Information.class); startActivity(intent); } public void doRestart(View view) { MainActivity.manx = MainActivity.startx; MainActivity.many = MainActivity.starty; MainActivity.direction = MainActivity.startDirection; MainActivity.distance = 0; setup(); redo(); } }


app/java/com.(the project name)/ImageExplore - code for explore gridview

package com.edkins.mazes; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; public class ImageExplore extends BaseAdapter { private AppCompatActivity mContext; public ImageExplore(AppCompatActivity c) {mContext = c;} public int getCount() {return 49;} public Object getItem(int position) {return null;} public long getItemId(int position) {return 0;} public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(mContext); GridView explore = (GridView) mContext.findViewById(R.id.exploreView); int w = explore.getWidth() / 7; imageView.setLayoutParams(new GridView.LayoutParams(w, w)); } else { imageView = (ImageView) convertView; } imageView.setImageResource(MainActivity.exploreMaze[position]); return imageView; } }


app/res/layout/birdseye.xml - bird's eye view screen format

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".BirdsEye"> <ImageView android:id="@+id/backPic" android:src="@drawable/back" android:onClick="doBack" android:layout_width="100dp" android:layout_height="50dp" android:contentDescription="@string/mazeText" /> <TextView android:id="@+id/birdseyeName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" style="@style/MenuTheme" android:layout_toRightOf="@id/backPic" android:layout_toEndOf="@id/backPic" /> <GridView android:id="@+id/birdseyeView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/backPic" /> </RelativeLayout>


app/java/com.(the project name)/Birdseye - code for bird's eye view screen

package com.edkins.mazes; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.GridView; import android.widget.TextView; public class BirdsEye extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.birdseye); TextView output = (TextView) findViewById(R.id.birdseyeName); output.setText(MainActivity.name); GridView birdView = (GridView) findViewById(R.id.birdseyeView); birdView.setNumColumns(MainActivity.wide); birdView.setAdapter(new ImageBirdseye(this)); } public void doBack(View view) { Intent intent = new Intent(this, Explore.class); startActivity(intent); } }


app/java/com.(the project name)/ImageBirdseye - code for bird's eye view gridview

package com.edkins.mazes; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; public class ImageBirdseye extends BaseAdapter { private AppCompatActivity mContext; public ImageBirdseye(AppCompatActivity c) {mContext = c;} public int getCount() {return MainActivity.wide * MainActivity.deep;} public Object getItem(int position) {return null;} public long getItemId(int position) {return 0;} public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(mContext); GridView birdView = (GridView) mContext.findViewById(R.id.birdseyeView); int w = birdView.getWidth() / MainActivity.wide; imageView.setLayoutParams(new GridView.LayoutParams(w, w)); } else { imageView = (ImageView) convertView; } int y = position / MainActivity.wide; int x = position % MainActivity.wide; int output; if (MainActivity.maze [y][x]==0) {output=R.drawable.path;} else if (MainActivity.maze [y][x]==1) {output=R.drawable.hedge;} else {output=R.drawable.outside;} if (x == MainActivity.manx && y == MainActivity.many) { if (MainActivity.direction == 0) {output=R.drawable.east;} else if (MainActivity.direction == 1) {output=R.drawable.south;} else if (MainActivity.direction == 2) {output=R.drawable.west;} else if (MainActivity.direction == 3) {output=R.drawable.north;} } imageView.setImageResource(output); return imageView; } }


app/res/layout/information.xml - information screen format

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Information"> <ImageView android:id="@+id/backPic" android:src="@drawable/back" android:onClick="doBack" android:layout_width="100dp" android:layout_height="50dp" android:contentDescription="@string/mazeText" /> <TextView android:id="@+id/infoName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" style="@style/MenuTheme" android:layout_toRightOf="@id/backPic" android:layout_toEndOf="@id/backPic" /> <TextView android:id="@+id/infoText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="@dimen/activity_vertical_margin" android:layout_below="@id/backPic" /> </RelativeLayout>


app/java/com.(the project name)/Information - code for information screen

package com.edkins.mazes; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class Information extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.information); TextView output = (TextView) findViewById(R.id.infoName); output.setText(MainActivity.name); TextView output2 = (TextView) findViewById(R.id.infoText); output2.setText(MainActivity.info); } public void doBack(View view) { Intent intent = new Intent(this, Explore.class); startActivity(intent); } }


Index to my other websites

© Jo Edkins 2016