poniedziałek, 9 listopada 2020

[Let`s go with golang] Image progressing

 There are many issues to simple programs. For me The most intresting is change image.

Golang have good library to image so was funny. 

I had problem to type of values. Libs use RGB in uint8 (0,255) but I need avarage in to greater scope (3x255) so I converted values to int32, I was doing my job and converted back.

I wanted do "black and white"  and "sepia" transformation

SOURCE






piątek, 6 listopada 2020

[Let`s go with golang] Simple Challange

 I found task, but maybe it found me.

Task to PHP:

"Write a 10x5 table with values ​​from 1-50".

I prefer go so I write in go :)

func main() {
var index int =1
var x=5
var y=10
for i := 0; i < x; i++ {
for j := 0; j < y; j++ {
fmt.Print("___")
}
fmt.Println()
fmt.Print("|")
for j := 0; j < 10; j++ {
strconv.Itoa(index)
fmt.Printf("%2s|",strconv.Itoa(index))
index++
}
fmt.Println()
}
for j := 0; j < 10; j++ {
fmt.Print("___")
}
}

And effect: