Exemplo n.º 1
0
func write1Gr(s byte, x, y int) {
	//
	if underX {
		t := string(s)
		z.ToHellWithUTF8(&t)
		xker.Write(t, x, y, transparent)
		return
	}
	if !visible ||
		x < 0 || x >= int(nX[mode]-actualCharwidth) ||
		y < 0 || y >= int(nY[mode]-actualCharheight) {
		return
	}
	CF := col.CodeF
	LB := actualLinewidth
	actualLinewidth = Thin
	for Y := uint(0); Y < actualCharheight; Y++ {
		for X := uint(0); X < actualCharwidth; X++ {
			if pointed(actualFontsize, s, Y, X) {
				col.CodeF = CF
				point(x+int(X), y+int(Y))
			} else if !transparent {
				col.CodeF = col.CodeB
				point(x+int(X), y+int(Y))
			}
		}
	}
	col.CodeF = CF
	actualLinewidth = LB
}
Exemplo n.º 2
0
func replace(s *string, p uint, c byte) {
	//
	n := len(*s)
	if int(p) >= n {
		return
	}
	t := string(c)
	*s = (*s)[:p] + t + (*s)[p+1:]
	z.ToHellWithUTF8(s)
}
Exemplo n.º 3
0
func const_(c byte, n uint) string {
	//
	s := ""
	for i := uint(0); i < n; i++ {
		t := string(c)
		z.ToHellWithUTF8(&t)
		s += t
	}
	return s
}
Exemplo n.º 4
0
func writeInvGr(s string, x, y int) {
	//
	z.ToHellWithUTF8(&s)
	n := len(s)
	if n == 0 {
		return
	}
	if underX {
		xker.WriteInvert(s, x, y, transparent)
		return
	}
	if !visible || x < 0 || y < 0 {
		return
	}
	for i := 0; i < n; i++ {
		write1InvGr(s[i], x+i*int(actualCharwidth), y)
	}
}
Exemplo n.º 5
0
func write1InvGr(Z byte, x, y int) {
	//
	if underX {
		t := string(Z)
		z.ToHellWithUTF8(&t)
		xker.WriteInvert(t, x, y, transparent)
		return
	}
	if !visible || x < 0 || x >= int(nX[mode]-actualCharwidth) ||
		y < 0 || y >= int(nY[mode]-actualCharheight) {
		return
	}
	for Y := uint(0); Y < actualCharheight; Y++ {
		for X := uint(0); X < actualCharwidth; X++ {
			if pointed(actualFontsize, Z, Y, X) {
				pointInv(x+int(X), y+int(Y))
			} else if !transparent {
				pointInv(x+int(X), y+int(Y))
			}
		}
	}
}
Exemplo n.º 6
0
func write(S string, L, C uint) {
	//
	n := len(S)
	if C+uint(n) > nColumns {
		n = int(nColumns - C)
	}
	if n == 0 {
		return
	}
	z.ToHellWithUTF8(&S)
	n = len(S)
	if underX {
		xker.Write(S, int(C*actualCharwidth), int(L*actualCharheight), transparent)
	} else {
		if !visible {
			return
		}
		for s := 0; s < n; s++ {
			write1(S[s], L, C+uint(s))
		}
	}
}
Exemplo n.º 7
0
func (x *Imp) Generate() {
	//
	b := make([]byte, x.length)
	b[0] = upper[rand.Natural(uint(len(upper)))]
	for i := uint(1); i < x.length; i++ {
		b[i] = lower[rand.Natural(uint(len(lower)))]
	}
	x.content = string(b)
	z.ToHellWithUTF8(&x.content)
	/*
	     n:= 3 + rand.Natural (x.length - 2)
	     if n >= x.length {
	       n = x.length - 1
	     }
	     b:= rand.Natural (2) % 2 == 1
	     s:= x.length
	     for i:= 0; i < int(n); i++ {
	       if (i % 2 == 1) == b {
	         B[i] = randomkonsonant ()
	         if B[i] == 's' && i + 2 < int(n) {
	           s = uint(i)
	         }
	       } else {
	         B[i] = randomvokal ()
	       }
	       if i == 0 {
	   //      B[i] = CAP (B[i])
	       }
	     }
	     if s < x.length {
	       B[s + 1] = 'c'
	       B[s + 2] = 'h'
	     }
	     for i:= n; i <= x.length; i++ {
	   //    B[i] = 0C
	     }
	*/
}
Exemplo n.º 8
0
func words(s string) (uint, []string, []uint) {
	//
	z.ToHellWithUTF8(&s)
	var t []string
	var p []uint
	l := properLen(s)
	spaceBefore := true
	n := uint(0)
	for i := uint(0); i < l; i++ {
		if s[i] == ' ' {
			spaceBefore = true
		} else {
			if spaceBefore {
				t = append(t, string(s[i]))
				p = append(p, i)
				n++
				spaceBefore = false
			} else {
				t[n-1] += string(s[i])
			}
		}
	}
	return n, t, p
}
Exemplo n.º 9
0
func ins1(s *string, c byte, p uint) {
	//
	t := string(c)
	z.ToHellWithUTF8(&t)
	ins(s, t, p)
}
Exemplo n.º 10
0
func lat1(s *string) {
	//
	z.ToHellWithUTF8(s)
}
Exemplo n.º 11
0
func set(S *string, T string) {
	//
	*S = T
	z.ToHellWithUTF8(S)
}