Skip to content

Commit

Permalink
set data wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Sep 17, 2020
1 parent 7e77c36 commit 5895e7c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
16 changes: 13 additions & 3 deletions aip.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package aip

import (
"fmt"
"log"
"strconv"
"strings"

Expand Down Expand Up @@ -30,7 +32,7 @@ func New() *Aip {
return &Aip{}
}

func (a *Aip) SetData(bobTx bob.Tx) {
func (a *Aip) SetData(bobTx *bob.Tx) {
var data []string

if len(a.Indicies) == 0 {
Expand All @@ -40,14 +42,22 @@ func (a *Aip) SetData(bobTx bob.Tx) {
for _, tape := range output.Tape {
for _, cell := range tape.Cell {
if cell.S != Prefix {
// Skip the OPS
if cell.Ops != "" {
log.Println("Skip ops")
continue
}
log.Println("Not the end", cell.S)
data = append(data, cell.S)
} else {
log.Println("We've hit the end", cell.S)
data = append(data, "|")
a.Data = data
return
}
}
}
}
a.Data = data
} else {
var indexCt = 0
for _, output := range bobTx.Out {
Expand Down Expand Up @@ -139,7 +149,7 @@ func ValidateTapes(tapes []bob.Tape) bool {

for _, cell := range tape.Cell {
if cell.Op > 0 {
data = append(data, string(cell.Op))
data = append(data, fmt.Sprintf("%d", cell.Op))
continue
}

Expand Down
Loading

0 comments on commit 5895e7c

Please sign in to comment.