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 }
func main() { // scr.Switch(scr.TXT) var today, birthday *Imp today = New() today.Actualize() birthday = New() birthday.SetColours(col.LightWhite, col.Blue) scr.Colour(col.Yellow) scr.Write("Ihr Geburtsdatum:", 12, 0) birthday.Edit(12, 18) if birthday.Empty() { birthday.Actualize() } else { scr.Write(" war ein ", 12, 26) birthday.SetFormat(WD) birthday.Write(12, 35) errh.Error2("Sie sind heute", birthday.Distance(today), "Tage alt.", 0) } scr.Colours(col.ScreenF, col.ScreenB) scr.Cls() errh.Hint(" vor-/rückwärts: Pfeiltasten fertig: Esc ") var ( c kbd.Comm t uint ) neu := true loop: for { if neu { birthday.WriteYear(0, 0) neu = false } switch c, t = kbd.Command(); c { case kbd.Esc: break loop case kbd.Down: if t == 0 { birthday.Inc(Yearly) } else { birthday.Inc(Decadic) } neu = true case kbd.Up: if t == 0 { birthday.Dec(Yearly) } else { birthday.Dec(Decadic) } neu = true case kbd.PrintScr: birthday.PrintYear(0, 0) prt.GoPrint() } } ker.Terminate() }
func ProtokollSchalten(ein bool) { // sollProtokolliertWerden = ein scr.Colours(col.ErrorF, col.ErrorB) if sollProtokolliertWerden { // rob.aktionsfolge = rob.aktionsfolge [0:0] scr.Write("Protokoll eingeschaltet", 0, scr.NColumns()-23) } else { scr.Write(" ", 0, scr.NColumns()-23) } }
func (W *Welt) Ausgeben() { // l := str.Clr(scr.NColumns()) scr.Colours(farbeV, farbeH) scr.Write(l, 0, 0) // kollidiert mit geplanter Ausgabe des Weltnamens scr.Write(l, 1, 0) scr.Write(l, scr.NLines()-2, 0) // scr.Write (l, scr.NLines() - 3, 0) for y := null; y < nY; y++ { for x := null; x < nX; x++ { platzAusgeben(y, x) } } W.schatten.ausgeben() }
func (X *Imp) Write(l, c uint) { // r := rep[X.nr] switch format { case Short: switch system { case Life: f, b := r.cf[X.mark], r.cb[X.mark] if X.nr == nothing { f, b = b, f } x, y := int(8*c)+8, int(16*l)+8 scr.Colour(f) scr.Circle(x, y, 6) scr.Circle(x, y, 5) scr.Colour(b) scr.CircleFull(x, y, 2) case Eco: for y := 0; y < Height; y++ { for x := 0; x < Width; x++ { f, b := r.cf[X.mark], r.cb[X.mark] // ! if r.img[y][x] == ' ' { f, b = b, f } scr.Colours(f, b) scr.Point(Width*int(c)/2+x, Height*int(l)+y) } } } case Long: scr.Colour(r.cf[plantNothing]) scr.Write(r.word, l, c) } }
func control() { // scr.SwitchFontsize(font.Normal) scr.Write(" ", 1, 0) scr.WriteNat(figures.Num(), 1, 0) scr.WriteNat(figures.NumPred(func(a Any) bool { return a.(*fig2.Imp).Marked() }), 1, 5) }
func suchen() { // /* const maxU = 8 var ( startlinie, ziellinie [maxU]Linie startnummer, zielnummer [maxU]uint n, imin, kmin uint ) t1, t2:= netz.Get2 () bhf1, bhf2:= t1.(*bahnhof.Imp), t2.(*bahnhof.Imp) startlinie [0], startnummer [0] = bhf1.Linie (), bhf1.Nummer () ziellinie [0], zielnummer [0] = bhf2.Linie (), bhf2.Nummer () ss, zz:= 1, 1 netz.Trav (func (a Any) { bhf:= a.(*bahnhof.Imp) if bhf.Equiv (bhf1) { startlinie [ss], startnummer [ss] = bhf.Linie (), bhf.Nummer () ss ++ } else if bhf.Equiv (bhf2) { ziellinie [zz], zielnummer [zz] = bhf.Linie (), bhf.Nummer () zz ++ } }) nmin:= uint(ker.MaxNat) for i:= 0; i < ss; i++ { for k:= 0; k < zz; k++ { l, n:= startlinie [i], startnummer [i] l1, n1:= ziellinie [k], zielnummer [k] if ! netz.ExPred2 (func (a Any) bool { b:= a.(*bahnhof.Imp); return b.Linie() == l && b.Nummer() == n }, func (a Any) bool { b:= a.(*bahnhof.Imp); return b.Linie() == l1 && b.Nummer() == n1 }) { ker.Stop (pack, 4) } netz.Actualize () n = netz.LenAct () if n < nmin { nmin = n imin, kmin = uint(i), uint(k) } } } l, n:= startlinie [imin], startnummer [imin] l1, n1:= ziellinie [kmin], zielnummer [kmin] if ! netz.ExPred2 (func (a Any) bool { b:= a.(*bahnhof.Imp); return b.Linie() == l && b.Nummer() == n }, func (a Any) bool { b:= a.(*bahnhof.Imp); return b.Linie() == l1 && b.Nummer() == n1 }) { ker.Stop (pack, 5) } */ netz.Actualize() write(true) scr.Colours(col.HintF, col.HintB) scr.SwitchTransparence(false) na := netz.LenAct() scr.Write("kürzeste Verbindung "+nat.String(na)+" Minuten", 0, 0) scr.SwitchTransparence(true) }
func (R *Imp) melden() { // if Roboterwelt.kloetze(R.Y, R.X) > 0 { nat.SetColours(farbe[R.nr], farbeH) nat.Write(uint(Roboterwelt.kloetze(R.Y, R.X)), 0, 32+2) } else { scr.Colours(farbeH, farbeH) scr.Write(" ", 0, 32) } }
func (x *Imp) Write(l, c uint) { // if x.num == 0 { return } scr.Colours(x.cF, x.cB) l += x.l0 for i := uint(0); i < x.num; i++ { scr.Write(x.mask[i], l+x.l[i], c+x.c[i]) } }
func (x *Imp) Write(l, c uint) { // scr.Colours(col.White, col.Blue) scr.WriteNat(x.num, l, c) c += 4 for i := uint(0); i < max; i++ { scr.Colours(col.Yellow, col.Red) scr.WriteNat(x.pos[i], l, c) c += 4 scr.Colours(col.White, col.Blue) scr.Write(x.content[i].(*text.Imp).String(), l, c) c += 10 } scr.Colours(col.Yellow, col.Red) scr.WriteNat(x.pos[max], l, c) }
func (B *Imp) Write(s string, l, c uint) { // if l >= scr.NLines() { return } if c >= scr.NColumns() { return } // Wd (&s, s) n, b := uint(len(s)), B.width if c+b > scr.NColumns() { B.width = scr.NColumns() - c } if B.width == 0 { B.width = n } if B.width > n { B.width = n } if B.width < n { Norm(&s, B.width) } // Norm (&s, B.width) if B.numerical || B.TRnumerical { Move(&s, false) } scr.Lock() scr.Colours(B.cF, B.cB) if B.transparent { scr.SwitchTransparence(true) } scr.Write(s, l, c) if B.transparent { scr.SwitchTransparence(false) } scr.Unlock() B.width = b }
func April1st() { col.ScreenF, col.ScreenB = col.White, col.Black scr.Cls() scr.MouseCursor(false) scr.Colour(col.White) scr.Write("Found evil software: \" \"", 7, x0) doof(7, 22) scr.Colour(col.White) scr.Write("Remove (yes/no) ?", y0, x0) b := box.New() b.Wd(3) t := "yes" b.Edit(&t, y0, 23) scr.WarpMouseGr(2*int(scr.NX()), 2*int(scr.NY())) b.Colours(col.LightOrange, col.Black) b.Write("yes", y0, 23) doodle(col.LightWhite, 2) doodle(col.LightWhite, 2) doodle(col.LightYellow, 5) doodle(col.Yellow, 3) doodle(col.LightOrange, 5) doodle(col.Orange, 8) doodle(col.LightRed, 3) // TODO erase all (f + "*.tmp") t = str.Clr(70) scr.Write(t, y0, x0) scr.Write(t, y0+1, x0) col.ScreenF, col.ScreenB = col.LightGreen, col.DarkBlue scr.Cls() scr.Write("The murus-tool has removed \" \" - your disk is reformatted :-)", y0, x0) doof(y0, 28) scr.Colour(col.LightWhite) scr.Write("Please install Linux, TeX, mercurial, Go and murus completely new !", y0+2, x0) ker.Sleep(20) ker.Terminate() }
func doof(y, x uint) { scr.Colour(col.LightOrange); scr.Write("d(o,o)f", y, x0+x) }