package main import ( "flag" "fmt" "math/rand" "time" . "github.com/logrusorgru/aurora" ) var heartnum = flag.Int("h", 7, "Number of hearts to print") var heartSpread = flag.Int("s", 10, "random number spread") var words = flag.String("w", "", "words to be displayed") // shape | WS calculation /* @@ @@ 6 + 2 @ @ @ @ 5 + 2 + 1 + 2 @ @ 6 + 5 @ @ 7 + 3 @ @ 8 +1 @ 9 */ /* @@@ @@@ 7 + 3 @ @ @ @ 6 + 3 + 1 + 3 @ @ 7 + 7 @ @ 8 + 5 @ @ 10 + 1 @ 11 */ /* @@@@ @@@@ 5 + 4 @ @ @ @ 4 + 4 + 2 + 4 @ @@ @ 3 + 6 + 0 + 6 @ @ 4 + 12 @ @ 5 + 9 @ @ 6 + 8 @ @ 7 + 6 @ @ 8 + 4 @ @ 9 + 2 @@ 10 + 0 */ func smHeart(x int) { //First Line for i := 0; i <= 13+x; i++ { switch i { default: heartBleed(" ") case x + 7, x + 8, x + 12: heartBleed("@") case x + 13: heartBleedln("@") } } //Second Line for i := 0; i <= 14+x; i++ { switch i { default: heartBleed(" ") case x + 6, x + 9, x + 11: heartBleed("@") case x + 14: heartBleedln("@") } } //Third Line for i := 0; i <= 13+x; i++ { switch i { default: heartBleed(" ") case x + 7: heartBleed("@") case x + 13: heartBleedln("@") } } //Fourth Line for i := 0; i <= 12+x; i++ { switch i { default: heartBleed(" ") case x + 8: heartBleed("@") case x + 12: heartBleedln("@") } } //Fifth Line for i := 0; i <= 11+x; i++ { switch i { default: heartBleed(" ") case x + 9: heartBleed("@") case x + 11: heartBleedln("@") } } //Sixth Line for i := 0; i <= 10+x; i++ { switch i { default: heartBleed(" ") case x + 10: heartBleedln("@") } } } func medHeart(x int) { for i := 0; i <= 16+x; i++ { switch i { default: heartBleed(" ") case x + 8, x + 9, x + 10, x + 14, x + 15: heartBleed("@") case x + 16: heartBleedln("@") } } for i := 0; i <= 17+x; i++ { switch i { default: heartBleed(" ") case x + 7, x + 11, x + 13: heartBleed("@") case x + 17: heartBleedln("@") } } for i := 0; i <= 16+x; i++ { switch i { default: heartBleed(" ") case x + 8: heartBleed("@") case x + 16: heartBleedln("@") } } for i := 0; i <= 15+x; i++ { switch i { default: heartBleed(" ") case x + 9: heartBleed("@") case x + 15: heartBleedln("@") } } for i := 0; i <= 13+x; i++ { switch i { default: heartBleed(" ") case x + 11: heartBleed("@") case x + 13: heartBleedln("@") } } for i := 0; i <= 12+x; i++ { switch i { default: heartBleed(" ") case x + 12: heartBleedln("@") } } } func lrgHeart(x int) { //Line 1 for i := 0; i <= 17+x; i++ { switch i { default: heartBleed(" ") case x + 6, x + 7, x + 8, x + 9, x + 14, x + 15, x + 16: heartBleed("@") case x + 17: heartBleedln("@") } } //Line 2 for i := 0; i <= 18+x; i++ { switch i { default: heartBleed(" ") case x + 5, x + 10, x + 13: heartBleed("@") case x + 18: heartBleedln("@") } } //Line 3 for i := 0; i <= 19+x; i++ { switch i { default: heartBleed(" ") case x + 4, x + 11, x + 12: heartBleed("@") case x + 19: heartBleedln("@") } } //Line 4 for i := 0; i <= 18+x; i++ { switch i { default: heartBleed(" ") case x + 5: heartBleed("@") case x + 18: heartBleedln("@") } } //Line 5 for i := 0; i <= 17+x; i++ { switch i { default: heartBleed(" ") case x + 6: heartBleed("@") case x + 17: heartBleedln("@") } } //Line 6 for i := 0; i <= 15+x; i++ { switch i { default: heartBleed(" ") case x + 8: heartBleed("@") case x + 15: heartBleedln("@") } } //Line 7 for i := 0; i <= 14+x; i++ { switch i { default: heartBleed(" ") case x + 9: heartBleed("@") case x + 14: heartBleedln("@") } } //Line 8 for i := 0; i <= 13+x; i++ { switch i { default: heartBleed(" ") case x + 10: heartBleed("@") case x + 13: heartBleedln("@") } } //Line 9 for i := 0; i <= 12+x; i++ { switch i { default: heartBleed(" ") case x + 11: heartBleed("@") case x + 12: heartBleedln("@") } } } //rand num to modify x position func randomMod() int { rand.Seed(time.Now().UnixNano()) min := 0 max := 59 return (rand.Intn(max-min+1) + min) } func pos(x int) (int, int) { return x + randomMod(), randomMod() } //Basically conrtols printing everything func whSp(in int) { x, y := pos(in) switch { case y <= 20: smHeart(x) wordFuckery(x, y, *words) case y <= 40: medHeart(x) wordFuckery(x, y, *words) case y <= 60: lrgHeart(x) wordFuckery(x, y, *words) } } //TODO make it pretty /* func color(wIn string) { for i := 0; i <= 8; i++ { switch i { case 0: brush := colorize.New("Black") brush.Paint(wIn) case 1: } } } */ //TODO handles words n stuff i guess func wordFuckery(in int, hearts int, words string) { //take number of hearts //divide by number of words //display word box if count is at a certin threshhold //s := strings.Split(words, " ") x, _ := pos(in) switch hearts { case 5, 10, 15, 20, 25, 30, 35, 40, 50, 55: for i := 0; i <= x; i++ { heartBleed(" ") } heartBleedln(words) } } // prints heart strings func heartBleed(s string) { fmt.Print(Magenta(s)) } func heartBleedln(s string) { fmt.Println(Magenta(s)) } func main() { flag.Parse() x := *heartSpread for i := 0; i <= *heartnum; i++ { whSp(x) x-- } }