Andrews-Curtis Project Porgress
So far I have managed to create the base objects that will allow for the manipluation of the words and letters. I chose to represent each letter as a number. a->1 b->2 c->3 … To represent the inverse, is store -1, -2, -3… it is easier to play with numbers that letters. This also makes reducing extremely. If a number + its neighbor = 0 then you know they are inverses and can be reduced out.
Alabhabet represents the alphabet of lettes that can make up the words. It can also be used to obtain a random letter or random word.
Public Class Alphabet
Public Max As Integer
Private rnd As New Random()
Public Sub New(ByVal Mx As Integer)
Public Sub SetMax(ByVal Mx As Integer)
Public Function RandomLetter() As Integer
Public Function RandomWord(Optional ByVal Size As Integer = -1) As Word
End Class
Word reperesents a word. It holds the letters and the different operations that can be performed to a word.
Public Class Word
Public Letters As New ArrayList
Public Sub New()
Public Sub New(ByVal ary As ArrayList)
Public Sub New(ByVal LettersString As String)
Public Function Inverse() As Word
Public Sub MultiplyBefore(ByVal Wrd As Word)
Public Sub MultiplyAfter(ByVal Wrd As Word)
Public Sub Reduce()
Public Sub ReplaceNumber(ByVal OldNum As Integer, ByVal NewNum As Integer)
Public Overrides Function ToString() As String
End Class
Words holds a collection of words. It lets you manipulate a group of words all at once.
Public Class Words
Public wrds As New ArrayList
Private rnd As New Random()
Public Sub New()
Public Sub New(ByVal ary As ArrayList)
Public Sub AddWord(ByVal Wrd As Word)
Public Sub ClearWords()
Public Function Count() As Integer
Public Sub ReplaceLetter(ByVal OldNum As Integer, ByVal NewNum As Integer)
Public Sub MultiplyBefore(ByVal j As Integer, ByVal k As Integer)
Public Sub MultiplyAfter(ByVal j As Integer, ByVal k As Integer)
Public Sub InverseWord(ByVal Wrd As Integer)
Public Sub IverseRandomWord()
Public Sub MultiplyRandomWord(ByVal Wrd As Integer, ByVal Random As Word)
Public Sub Reduce()
Public Overrides Function ToString() As String
End Class
All this allows me to easiy represent the objects within in the program. I am still working on the details of how to use these to show that the theorm is true or false. Does anyone else have any progress to report?
Leave a comment