<?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=SE701%3AUntangling_a_string</id>
	<title>SE701:Untangling a string - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE701%3AUntangling_a_string"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE701:Untangling_a_string&amp;action=history"/>
	<updated>2026-06-29T07:05:57Z</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=SE701:Untangling_a_string&amp;diff=96&amp;oldid=prev</id>
		<title>Mark: New page: Found this assignement online. Seems more interesting than Traveling salesperson. So I&#039;ll do this first. For a complete description of the problem see https://www.se.auckland.ac.nz/wiki/im...</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE701:Untangling_a_string&amp;diff=96&amp;oldid=prev"/>
		<updated>2008-02-15T20:12:33Z</updated>

		<summary type="html">&lt;p&gt;New page: Found this assignement online. Seems more interesting than Traveling salesperson. So I&amp;#039;ll do this first. For a complete description of the problem see https://www.se.auckland.ac.nz/wiki/im...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Found this assignement online. Seems more interesting than Traveling salesperson. So I&amp;#039;ll do this first. For a complete description of the problem see https://www.se.auckland.ac.nz/wiki/images/4/4c/P45-meredith.pdf&lt;br /&gt;
&lt;br /&gt;
Code so far:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 (defun validate-tripcode (tripcode)&lt;br /&gt;
  (let ((found (make-array 0 :fill-pointer 0 :adjustable t)) (count 0) (match-found NIL) (all-matches-found T))&lt;br /&gt;
    (dolist (x tripcode)&lt;br /&gt;
      (if (eql (position (first x) found :test #&amp;#039;string=) NIL)&lt;br /&gt;
          (dotimes (i (- (length tripcode) (+ count 1)))&lt;br /&gt;
            (setf match-found NIL)&lt;br /&gt;
            (let* ((current-count (+ count i 1)) (current-point (nth current-count tripcode))) &lt;br /&gt;
              (cond ((crossing-point-opposite current-point x) (vector-push-extend (first x) found) (setf match-found T)(return))))))&lt;br /&gt;
      (setf all-matches-found (and all-matches-found match-found)))&lt;br /&gt;
    all-matches-found)) &lt;br /&gt;
&lt;br /&gt;
 (defun crossing-point-opposite (pair1 pair2)&lt;br /&gt;
  (if (and (string= (first pair1) (first pair2)) (or (and (string= (second pair1) &amp;quot;o&amp;quot;) (string= (second pair2) &amp;quot;u&amp;quot;)) &lt;br /&gt;
                                                     (and (string= (second pair1) &amp;quot;u&amp;quot;) (string= (second pair2) &amp;quot;o&amp;quot;))))&lt;br /&gt;
      T))&lt;br /&gt;
&lt;br /&gt;
 (defun similar-crossing-points (pair1 pair2)&lt;br /&gt;
  (if (or (and (string= (second pair1) &amp;quot;o&amp;quot;) (string= (second pair2) &amp;quot;o&amp;quot;)) &lt;br /&gt;
          (and (string= (second pair1) &amp;quot;u&amp;quot;) (string= (second pair2) &amp;quot;u&amp;quot;)))&lt;br /&gt;
      T))&lt;br /&gt;
&lt;br /&gt;
 (defun type1-move (tripcode)&lt;br /&gt;
  (loop&lt;br /&gt;
   with type1-list NIL&lt;br /&gt;
   for i from 0 to (- (length tripcode) 2)&lt;br /&gt;
   for x in tripcode &lt;br /&gt;
   do (when (crossing-point-opposite x (nth (+ 1 i) tripcode))  &lt;br /&gt;
        (setf type1-list (list i (+ 1 i)))&lt;br /&gt;
        (return type1-list))))&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>