<commit_before>package piet

import (
  "fmt"
)

const (
  white = 18
  black = 19
)

func (p *Piet) Run() {
  var cont bool = true
  var dpstat = []string{"RIGHT", "DOWN", "LEFT", "UP"}
  var ccstat = []string{"LEFT", "RIGHT"}
  for i := 1; cont; i++ {
    if p.debug {
      fmt.Printf("step %04d : %s ; DP=%s, CC=%s\n", i, p.now.ToString(), dpstat[p.DP], ccstat[BoolToInt64(!p.CC)])
    }
    cont = p.Step()
    if p.debug { fmt.Println(p.stack) }
  }
  if p.debug { fmt.Println("Finished.") }
}

var dr = [...]Point{Point{1, 0}, Point{0, 1}, Point{-1, 0}, Point{0, -1}}

var commandsstr = [][3]string{
  {"None", "Push", "Pop"},
  {"Add", "Subtract", "Multiply"},
  {"Divide", "Mod", "Not"},
  {"Greater", "Pointer", "Switch"},
  {"Duplicate", "Roll", "InNumber"},
  {"InChar", "OutNumber", "OutChar"}}

func (p *Piet) Step() bool {
  var commands = [][3]func(){
    {p.None, p.Push, p.Pop},
    {p.Add, p.Subtract, p.Multiply},
    {p.Divide, p.Mod, p.Not},
    {p.Greater, p.Pointer, p.Switch},
    {p.Duplicate, p.Roll, p.InNumber},
    {p.InChar, p.OutNumber, p.OutChar}}

  var edge, dest Point
  if p.GetCodel(p.now) == white {
    edge = p.now<commit_msg>show colorname when debug mode<commit_after>package piet

import (
  "fmt"
)

const (
  white = 18
  black = 19
)

func (p *Piet) Run() {
  var cont bool = true
  var dpstat = []string{"RIGHT", "DOWN", "LEFT", "UP"}
  var ccstat = []string{"LEFT", "RIGHT"}
  for i := 1; cont; i++ {
    if p.debug {
      fmt.Printf("step %04d : %s ; COLOR=%s, DP=%s, CC=%s\n", i, p.now.ToString(), colorname[p.GetCodel(p.now)], dpstat[p.DP], ccstat[BoolToInt64(!p.CC)])
    }
    cont = p.Step()
    if p.debug { fmt.Println(p.stack) }
  }
  if p.debug { fmt.Println("Finished.") }
}

var dr = [...]Point{Point{1, 0}, Point{0, 1}, Point{-1, 0}, Point{0, -1}}

var commandsstr = [][3]string{
  {"None", "Push", "Pop"},
  {"Add", "Subtract", "Multiply"},
  {"Divide", "Mod", "Not"},
  {"Greater", "Pointer", "Switch"},
  {"Duplicate", "Roll", "InNumber"},
  {"InChar", "OutNumber", "OutChar"}}

var colorname = []string{"LightRed", "Red", "DarkRed",
  "LightYellow", "Yellow", "DarkYellow",
  "LightGreen", "Green", "DarkGreen",
  "LightCyan", "Cyan", "DarkCyan",
  "LightBlue", "Blue", "DarkBlue",
  "LightMagenta", "Magenta", "DarkMagenta",
  "White", "Black"}

func (p *Piet) Step() bool {
  var commands = [][3]func(){
    {p.None, p.Push, p.Pop},
    {p.Add, p.Subtract, p.Multiply},
    {p.Divide, p.Mod, p.Not},
    {p.Greater, p.Pointer, p.Switch},
    {p.Duplicate, p.Roll, p.InNumber},
    {p.InChar, p.OutNumber, p.OutChar}}

  var edge, dest Point
  if p.GetCodel(p.now) == white {
    edge = p.now
{'fraction_non_alphanumeric': 0.23609022556390977, 'fraction_numerical': 0.014285714285714285, 'mean_word_length': 3.4129353233830844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '194790', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1094, 'n_words': 261}