Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -30,7 +30,7 @@ wireWorldRuleSet = new RuleSet
|
|||
int cell := s.at(x, y);
|
||||
|
||||
cell =>
|
||||
conductor
|
||||
conductor:
|
||||
{
|
||||
int number := s.LiveCell(x, y, electronHead);
|
||||
if (number == 1 || number == 2)
|
||||
|
|
@ -42,15 +42,15 @@ wireWorldRuleSet = new RuleSet
|
|||
^ conductor
|
||||
}
|
||||
}
|
||||
electronHead
|
||||
electronHead:
|
||||
{
|
||||
^ electronTail
|
||||
}
|
||||
electronTail
|
||||
electronTail:
|
||||
{
|
||||
^ conductor
|
||||
}
|
||||
!{
|
||||
!:{
|
||||
^ cell
|
||||
}
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ sealed class Model
|
|||
|
||||
constructor load(string stateString, int maxX, int maxY)
|
||||
{
|
||||
var strings := stateString.splitBy(newLineConstant).selectBy::(s => s.toArray()).toArray();
|
||||
var strings := stateString.splitBy(NewLineConstant).selectBy::(s => s.toArray()).toArray();
|
||||
|
||||
theSpace := IntMatrixSpace.allocate(maxX, maxY, RuleSet
|
||||
{
|
||||
|
|
@ -75,10 +75,10 @@ sealed class Model
|
|||
if (y < l.Length)
|
||||
{
|
||||
(l[y]) =>
|
||||
conductorLabel { retVal := conductor }
|
||||
headLabel { retVal := electronHead }
|
||||
tailLabel { retVal := electronTail }
|
||||
emptyLabel { retVal := empty }
|
||||
conductorLabel : { retVal := conductor }
|
||||
headLabel : { retVal := electronHead }
|
||||
tailLabel : { retVal := electronTail }
|
||||
emptyLabel : { retVal := empty }
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -117,27 +117,27 @@ sealed class Model
|
|||
int cell := theSpace.at(i, j);
|
||||
|
||||
cell =>
|
||||
conductor { label := conductorLabel }
|
||||
electronHead { label := headLabel }
|
||||
electronTail { label := tailLabel };
|
||||
conductor : { label := conductorLabel }
|
||||
electronHead : { label := headLabel }
|
||||
electronTail : { label := tailLabel };
|
||||
|
||||
console.write(label);
|
||||
Console.write(label);
|
||||
|
||||
j := j + 1
|
||||
};
|
||||
|
||||
i := i + 1;
|
||||
console.writeLine()
|
||||
Console.writeLine()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
Model model := Model.load(sample,10,30);
|
||||
for(int i := 0; i < 10; i += 1)
|
||||
{
|
||||
console.printLineFormatted("Iteration {0}",i);
|
||||
Console.printLineFormatted("Iteration {0}",i);
|
||||
model.print().run()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue