<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-X%3Asshi080</id>
	<title>SE250:lab-X:sshi080 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-X%3Asshi080"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-X:sshi080&amp;action=history"/>
	<updated>2026-06-04T22:28:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:lab-X:sshi080&amp;diff=9158&amp;oldid=prev</id>
		<title>Mark: 14 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-X:sshi080&amp;diff=9158&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:49Z</updated>

		<summary type="html">&lt;p&gt;14 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== LAB X ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
&lt;br /&gt;
Different states: 9! = 362880, because there is 9 blocks, e.g. the space can be at 9 different positions, then &amp;quot;1&amp;quot; can be at 8 different positions and so forth&amp;lt;br /&amp;gt;&lt;br /&gt;
Estimated Edges: Um.. this one is pretty hard, I think:&amp;lt;br /&amp;gt;&lt;br /&gt;
*4 different ways when space is in middle&lt;br /&gt;
*3 different ways when space is on the side&lt;br /&gt;
*2 different ways when space is in a corner&lt;br /&gt;
&lt;br /&gt;
Space in the middle, numbers can be different in 8! times, same with others.&lt;br /&gt;
8! * 4 + 8! * 3 + *1 * 2?&lt;br /&gt;
&lt;br /&gt;
There are some overlapping here obviously...&lt;br /&gt;
cbf thinking about it right now :D&lt;br /&gt;
&lt;br /&gt;
=== Task 2 ===&lt;br /&gt;
Some comments would have helped greatly, but I guess that is the point of this task :(&lt;br /&gt;
This is what I think the algorithm is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initialise a start state and a goal state, a list of possible states and the number of states already visited.&lt;br /&gt;
Call the search function and pass in the start state, goal state, the list of states possible and the number of states already visited.&lt;br /&gt;
&lt;br /&gt;
While the ordered state list is not empty:&lt;br /&gt;
&lt;br /&gt;
-Pop off the current state from the ordered list of states.&lt;br /&gt;
-If the current state is the goal state, break loop and record &amp;quot;success&amp;quot;&lt;br /&gt;
-Otherwise, get the children of the current state.&lt;br /&gt;
&lt;br /&gt;
For each children retrieved:&lt;br /&gt;
-Add to stateset if the child state is not present in the visitedmap&lt;br /&gt;
-Add to ordered state list&lt;br /&gt;
&lt;br /&gt;
Clear the children&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 3 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 Start:          1          3 Goal:&lt;br /&gt;
123456.78 - &amp;gt; 1234567.8  -&amp;gt;  12345678.&lt;br /&gt;
&lt;br /&gt;
1 2 3           1 2 3        1 2 3&lt;br /&gt;
4 5 6     - &amp;gt;   4 5 6    -&amp;gt;  4 5 6&lt;br /&gt;
. 7 8           7 . 8        7 8 .&lt;br /&gt;
&lt;br /&gt;
  |&lt;br /&gt;
  &lt;br /&gt;
  2&lt;br /&gt;
123.56478&lt;br /&gt;
&lt;br /&gt;
1 2 3&lt;br /&gt;
. 5 6     -&amp;gt;   ...&lt;br /&gt;
4 7 8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graph from graph.exe&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;http://img209.imageshack.us/img209/9073/68740268th0.png&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Task 4 ==&lt;br /&gt;
&lt;br /&gt;
Now I don&amp;#039;t know why malloc.h was there and was an Apple implementation, removing that allowed compilation using the unix command make.&lt;br /&gt;
&lt;br /&gt;
The output was:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
.78&lt;br /&gt;
 -&amp;gt;&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
7.8&lt;br /&gt;
 -&amp;gt;&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
78.&lt;br /&gt;
 -&amp;gt;&lt;br /&gt;
Visited 5 states&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 3 states are shown here (shortest route), the other 2 states would be swapping the 4 and . and then possibly 1 and . or 5 and .&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>