Commit a8b459a5 authored by Etienne Renault's avatar Etienne Renault

beem: remove hanoi

According to discusion #14.

* benchs/BEEM/hanoi.1.go: Here.
parent 1e996e0c
// Copyright (C) 2020 Laboratoire de Recherche et Developpement
// de l'EPITA (LRDE).
//
// This file is part of Go2Pins, a tool for Golang model-checking
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
var a [9]int = [9]int{100, 8 - 0, 8 - 1, 8 - 2, 8 - 3, 8 - 4, 8 - 5, 8 - 6, 8 - 7}
var a_act = 9
var b [9]int = [9]int{100, 0, 0, 0, 0, 0, 0, 0, 0}
var b_act = 1
var c [9]int = [9]int{100, 0, 0, 0, 0, 0, 0, 0, 0}
var c_act = 1
func AtoB() {
for {
if a[a_act-1] < b[b_act-1] {
b[b_act] = a[a_act-1]
b_act = b_act + 1
a[a_act-1] = 0
a_act = a_act - 1
}
}
}
func AtoC() {
for {
if a[a_act-1] < c[c_act-1] {
c[c_act] = a[a_act-1]
c_act = c_act + 1
a[a_act-1] = 0
a_act = a_act - 1
}
}
}
func BtoA() {
for {
if b[b_act-1] < a[a_act-1] {
a[a_act] = b[b_act-1]
a_act = a_act + 1
b[b_act-1] = 0
b_act = b_act - 1
}
}
}
func BtoC() {
for {
if b[b_act-1] < c[c_act-1] {
c[c_act] = b[b_act-1]
c_act = c_act + 1
b[b_act-1] = 0
b_act = b_act - 1
}
}
}
func CtoA() {
for {
if c[c_act-1] < a[a_act-1] {
a[a_act] = c[c_act-1]
a_act = a_act + 1
c[c_act-1] = 0
c_act = c_act - 1
}
}
}
func CtoB() {
for {
if c[c_act-1] < b[b_act-1] {
b[b_act] = c[c_act-1]
b_act = b_act + 1
c[c_act-1] = 0
c_act = c_act - 1
}
}
}
func main() {
go AtoB()
go AtoC()
go BtoA()
go BtoC()
go CtoA()
go CtoB()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment