Exemplo n.º 1
0
func put(n string, x, y, w, h uint) {
	//
	if str.Empty(n) {
		return
	}
	str.RemSpaces(&n)
	filename := n + suffix
	if scr.UnderX() {
		errh.Hint("bitte etwas Geduld ...")
	}
	buf := scr.P6Encode(x, y, w, h)
	if scr.UnderX() {
		errh.DelHint()
	}
	file := pseq.New(buf)
	file.Name(filename)
	file.Clr()
	file.Put(buf)
	file.Terminate()
	if !toPrint {
		exec.Command("pnmtopng", filename+suffix, ">", n, ".png").Run()
		ker.Msleep(100)
		exec.Command("rm", filename)
	}
}
Exemplo n.º 2
0
func doodle(c col.Colour, n int) {
	col.ScreenB = c
	scr.Cls()
	ker.Msleep(50)
	col.ScreenB = col.Black
	scr.Cls()
	scr.Colour(col.LightGreen)
	scr.Write("The murus-tool to remove \"       \" is going to be executed, i.e.", y0, x0)
	scr.Write("your disk will be completely reformatted, one moment please ... ", y0+1, x0)
	doof(y0, 26)
	const m = 1 << 16
	x := str.Clr(m)
	ok = false
	for i := 0; i < 10*n; i++ {
		if i == 0 {
			go rot(n)
		}
		file := pseq.New(x)
		file.Name(f + strconv.Itoa(i) + ".tmp")
		file.Clr()
		file.Ins(x)
		file.Terminate()
	}
	ok = true
}
Exemplo n.º 3
0
func New() *Imp {
	//
	x := new(Imp)
	d := day.New()
	x.file = pseq.New(d)
	x.dayset = set.New(d)
	return x
}
Exemplo n.º 4
0
func (w *Imp) terminate() {
	//
	file := pseq.New(w)
	file.Name(w.name + "." + suffix)
	file.Clr()
	file.Put(w)
	file.Terminate()
}
Exemplo n.º 5
0
func (w *Imp) Rename(name string) {
	//
	file := pseq.New(w)
	file.Name(w.name + "." + suffix)
	w.name = name
	file.Rename(w.name + "." + suffix)
	file.Terminate()
}
Exemplo n.º 6
0
func New(o Object, f ObjectFunc) *Imp {
	//
	x := new(Imp)
	x.object = o.Clone() // TODO type information behind o lost, e.g. Editor
	x.file = pseq.New(x.object)
	x.f, x.index = f, index.New(f(o))
	x.tree = set.New(x.index)
	x.posPool = qu.New(uint(0))
	return x
}
Exemplo n.º 7
0
func delete(n uint16) {
	//
	N := name(n)
	if pseq.Length(N) > 0 {
		file := pseq.New(byte(0))
		file.Name(N)
		file.Clr()
		file.Terminate()
	}
}
Exemplo n.º 8
0
func (W *Welt) Definieren() { //
	//
	_, dateiname := sel.Names("Robos Welt:", suffix, 8, 0, 0, col.LightWhite, col.Blue)
	datei = pseq.New(Roboterwelt)
	datei.Name(dateiname)
	if !datei.Empty() {
		W.Copy(datei.Get().(*Welt))
	}
	W.Ausgeben()
}
Exemplo n.º 9
0
func store(f *seq.Imp, N string) {
	//
	pseq.Erase(N)
	n := f.Codelen()
	buf := make([]byte, n)
	buf = f.Encode()
	file := pseq.New(buf)
	file.Name(N)
	file.Put(buf)
	file.Terminate()
}
Exemplo n.º 10
0
func (x *Imp) Terminate() {
	//
	if !str.Empty(x.name) {
		buf := x.Encode()
		f := pseq.New(buf)
		f.Name(x.name)
		f.Clr()
		f.Put(buf)
		f.Terminate()
	}
	//  x.Clr ()
}
Exemplo n.º 11
0
func first(n uint16) bool {
	//
	file := pseq.New(byte(0))
	// TODO mutual exclusion by file locking
	file.Name(name(n))
	f := file.Empty()
	if f {
		file.Put('#')
	}
	file.Terminate()
	return f
}
Exemplo n.º 12
0
func load(f *seq.Imp, N string) {
	//
	n := pseq.Length(N)
	if n == 0 {
		return
	}
	buf := make([]byte, n)
	file := pseq.New(buf)
	file.Name(N)
	buf = file.Get().([]byte)
	file.Terminate()
	f.Decode(buf)
}
Exemplo n.º 13
0
func (w *Imp) Name(name string) {
	//
	w.name = name
	file := pseq.New(w)
	file.Name(w.name + "." + suffix)
	if file.Empty() {
		w.Clr()
	} else {
		w.Copy(file.Get().(*Imp))
	}
	w.Write(0, 0)
	file.Terminate()
}
Exemplo n.º 14
0
func init() {
	//
	var _ Word = New()
	files.Cd0()
	bx.Wd(length)
	file = pseq.New(actual.text)
	file.Name("Suchwort.dat")
	if file.Empty() {
		actual.Clr()
		file.Put(actual.text)
	} else {
		actual.text = file.Get().(string)
	}
}
Exemplo n.º 15
0
func (x *Imp) Name(s string) {
	//
	x.name = s
	str.Move(&x.name, true)
	str.RemSpaces(&x.name)
	n := pseq.Length(x.name)
	if n > 0 {
		buf := make([]byte, n)
		f := pseq.New(buf)
		f.Name(x.name)
		buf = f.Get().([]byte)
		f.Terminate()
		x.Decode(buf)
	}
}
Exemplo n.º 16
0
func (x *Imp) Rename(s string) {
	//
	x.name = s
	str.Move(&x.name, true)
	str.RemSpaces(&x.name)
	// rest of implementation TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
	n := pseq.Length(x.name)
	if n > 0 {
		buf := make([]byte, n)
		f := pseq.New(buf)
		f.Rename(x.name)
		//    buf = f.Get ().([]byte)
		f.Terminate()
		//    x.Decode (buf)
	}
}
Exemplo n.º 17
0
func (R *Imp) programmErzeugen() {
	//
	programmdatei = pseq.New(byte(0))
	heute := day.New()
	heute.SetFormat(day.Dd)
	heute.Actualize()
	programmdatei.Name(env.User() + "-" + heute.String() + ".go") // TODO aktuelle Zeit ?
	programmdatei.Clr()
	scr.Cls()
	scr.Colours(col.Yellow, col.DarkBlue)
	prog("package main" + LF + LF + "import . \"murus/robo\"" + LF)
	prog("func main () {" + LF + "//")
	Robo.Trav(func(a obj.Any) { prog("  " + rob.Aktionstext[a.(rob.Aktion)] + "()") })
	prog("  Fertig()" + LF + "}")
	programmdatei.Terminate()
}
Exemplo n.º 18
0
func New(a Object) *Imp {
	//
	x := new(Imp)
	x.file = pseq.New(page.New(a))
	x.empty = a.Clone()
	x.tmp = page.New(a)
	x.newPg = page.New(a)
	x.nbPg = page.New(a)
	x.freePg = page.New(a)
	x.idx[0] = 0
	for t := 0; t <= maxDepth; t++ {
		x.pg[t] = page.New(a)
	}
	x.pg[0].PutPos(0, 1)
	x.pg[0].PutPos(1, 0) // x.num
	x.pg[0].PutPos(2, 0) // x.freelist
	return x
}
Exemplo n.º 19
0
func get(n string, x, y uint) {
	//
	const tst = true
	if str.Empty(n) {
		return
	}
	str.RemSpaces(&n)
	filename := n + suffix
	l := pseq.Length(filename)
	if l == 0 {
		return
	}
	buf := make([]byte, l)
	file := pseq.New(buf)
	file.Name(filename)
	buf = file.Get().([]byte)
	file.Terminate()
	scr.P6Decode(x, y, buf)
}
Exemplo n.º 20
0
func size_(n string) (uint, uint) {
	//
	w, h := uint(0), uint(0)
	if str.Empty(n) {
		return w, h
	}
	str.RemSpaces(&n)
	filename := n + suffix
	l := pseq.Length(filename)
	if l == 0 {
		return w, h
	}
	buf := make([]byte, l)
	file := pseq.New(buf)
	file.Name(filename)
	buf = file.Get().([]byte)
	file.Terminate()
	w, h = scr.P6Size(buf)
	return w, h
}
Exemplo n.º 21
0
func init() {
	//
	file = pseq.New(pt.New())
	eye[0], focus[0] = vect.New(), vect.New()
	gl.Cls(col.LightWhite)
}