Browse Source

Using growl as ANSI art. Updated testdoor to use.

Steve Thielemann 3 years ago
parent
commit
11c888980c
3 changed files with 133 additions and 72 deletions
  1. 2 2
      Makefile
  2. 23 0
      testdoor/growl.ans
  3. 108 70
      testdoor/testdoor.go

+ 2 - 2
Makefile

@@ -17,8 +17,8 @@ testdoor/fonts.go: font-out
 	cat *_font.go >> testdoor/fonts.go    
 	rm *_font.go
 
-testdoor/art.go: space.ans
-	./ansi-to-go.py main space.ans > testdoor/art.go
+testdoor/art.go: testdoor/growl.ans
+	./ansi-to-go.py main testdoor/growl.ans > testdoor/art.go
 
 space-ace/space.go: space.ans
 	./ansi-to-go.py main space.ans > space-ace/space.go

+ 23 - 0
testdoor/growl.ans

@@ -0,0 +1,23 @@
+ワワロロアアアアアアアアアアアアアアアロロワワ
+ワロロアアアアアアロロロロアア アアロロロロアアアアアロロ
+ロ  ーワワワローーーーロロロロロアアアアアロアー ーアロアアアアアロロローーーロワワ
+  ロ ーロロ゚  ワト  ワワワロ゚゚ロ    ーーー       アアロ ゙゙ロアア ロロ  ゚ーーロワ ロ゚゚ロワワ
+  ーーーロロー  ワワロ゚゚゚  ワロロロ゚゚ ロワ ゚゚ワワワロロロロア   アロロロロワワワ゚゚ ロ ゚ ロ  ゚゚゚゚ワワ
+  ーーーー ロ ゚゚゚゚ロワワ   ロロロロロワ゚゚゚ワ  ゚゚ロワロロ゚ロ ロ゚ ロワロ゚ロロ ワ゚ ゚ワ ロロ   ワロ゚゚゚
+    ーーー゚ロ ワ ゚ロワ゚ ロロ ワ゚ワ    ロ       ロ    ワ゚ワ ロロ ワ ロ゚
+    ーー ーーロロン ロロ  ゚゚゚゚゚ ゚゚゚ーーワワ゚゚゚ワワーー゚゚゚ ゚゚゚゚゚  ゚ ワ゚
+ーロアアア  ワワロワワワワ ワ゚゚ワーー゚゚゚ーーワ゚゚ ワワワワロワワ  ゚アアロ
+゙アアアワワ゚       ゚ワ ゚�゚゚゚゚゚゚゚�゚゚ ロロロロロロ゚゚ワアアアン
+  ー ー  ーー ーーー    ゙ロアアアアロロ゚ロ ゚ロ゚ ゚  ゚ロロロ ロロロ゚゚ ゚ロ゚ ゚  ーーーロン
+ ー  ーーーーーアーーアローー゚゚゚゚゚ ゚゚゚ ゚゚ーーロアー
+ーーーーーーー゚ワ゚ロ゚ワ ーーー
+    ーーーー゚アーー゚ワワーーーヷ ンワーーーワ ーワ゚
+ーー゚アー  ゚゚゙ロ゙ンロンロロ゙ロンロロンンロロ゙ンロン゚゚ ー゚ー
+ーーー ーー ー  ゙゙イア゚ーイ゚ー゚イーロ゚ー ゙゙ー ー゚  ア
+ー゚ワー  ンン゙ロロロロアアアロロロロン ンン ーー゚  ーーア
+ー   ーー゚ワ  ゙ン ロロロロアアアロロロロ  ゙ワ゚゚    ー   ワ   ワ   ワ  ワワ
+ー    ーー  ー゚ワワワ  ロロロロロロロロロロロ   ワワ    ー    ローアロロアアロローアーロ゚イー
+ー ーーー ーロイ ロンロロロロロロロロンロワイアアアロアイローーアイローーー
+ーー ー   ーロン ゙ンイロロロロロロイロン ロンワーアアアア  アイイ    ゚ロ    ン
+ーーーーーーー アーン゙ロロ゙ンンロ゙゙ン゙ン゙ンワー゚ ロア   アイア゙
+ーー  ー ーーーー゚゚゚゚゚゚゚゚゚゚゚゚ン   ワ゚    ーア

+ 108 - 70
testdoor/testdoor.go

@@ -87,9 +87,9 @@ func display_information(d *door.Door) {
 }
 
 func display_ansi(d *door.Door) {
-	space := SPACE()
+	art := GROWL()
 	d.Write(door.Clrscr)
-	for _, line := range space {
+	for _, line := range art {
 		if door.Unicode {
 			d.Write(door.CP437_to_Unicode(line) + door.CRNL)
 		} else {
@@ -106,132 +106,170 @@ func font_demo(d *door.Door) {
 	d.Write(door.Clrscr) //  + door.CRNL + door.CRNL)
 	fac := FontAmazonCyan()
 	output, l = fac.Output("ABCDEFGHIJKL")
-	centering = strings.Repeat(" ", (door.Width-l)/2)
+	if l > door.Width {
+		output, l = fac.Output("Cyan")
+	}
 
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(fmt.Sprintf("%s%s%s", centering, CP437Bytes_to_Unicode(o), door.Reset) + door.CRNL)
-		} else {
-			d.Write(fmt.Sprintf("%s%s%s", centering, string(o), door.Reset) + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(fmt.Sprintf("%s%s%s", centering, CP437Bytes_to_Unicode(o), door.Reset) + door.CRNL)
+			} else {
+				d.Write(fmt.Sprintf("%s%s%s", centering, string(o), door.Reset) + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 	fab := FontAnarchyBlue()
 	output, l = fab.Output("Bugz is Here!")
-	centering = strings.Repeat(" ", (door.Width-l)/2)
+	if l > door.Width {
+		output, l = fab.Output("Hello")
+	}
 
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 	unchain := FontUnchained()
 	output, l = unchain.Output("Hi There!")
-	centering = strings.Repeat(" ", (door.Width-l)/2)
+	if l > door.Width {
+		output, l = unchain.Output("Meow")
+	}
 
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 	press_a_key(d)
 
 	asylum := FontAsylum()
 	output, l = asylum.Output("Bugz ROCKS")
-	centering = strings.Repeat(" ", (door.Width-l)/2)
-	// centering = ""
+	if l > door.Width {
+		output, l = asylum.Output("Aslym")
+	}
 
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 	brain := FontBrainDmgBlu()
 	output, l = brain.Output("I'm so BLUE")
-	centering = strings.Repeat(" ", (door.Width-l)/2)
+	if l > door.Width {
+		output, l = brain.Output("Blue")
+	}
 
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 	boner := FontBoner()
 	output, l = boner.Output("Welcome!")
-	centering = strings.Repeat(" ", (door.Width-l)/2)
-
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 	press_a_key(d)
 
 	descent := FontDescent()
 	output, l = descent.Output("Meanwhile...")
 	if l > door.Width {
-		output, l = descent.Output("BUGZ !?!")
+		output, l = descent.Output("BUGZ")
 	}
-	centering = strings.Repeat(" ", (door.Width-l)/2)
 
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 	remorse := FontRemorse()
 	output, l = remorse.Output("Enjoy the fonts")
 	if l > door.Width {
 		output, l = remorse.Output("Amazing")
 	}
-	centering = strings.Repeat(" ", (door.Width-l)/2)
-
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 	dungeon := FontDungeon()
 	output, l = dungeon.Output("Until NEXT time")
 	if l > door.Width {
 		output, l = dungeon.Output("Beware")
 	}
-	centering = strings.Repeat(" ", (door.Width-l)/2)
-
-	for _, o := range output {
-		if door.Unicode {
-			d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
-		} else {
-			d.Write(centering + string(o) + door.Reset + door.CRNL)
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			if door.Unicode {
+				d.Write(centering + CP437Bytes_to_Unicode(o) + door.Reset + door.CRNL)
+			} else {
+				d.Write(centering + string(o) + door.Reset + door.CRNL)
+			}
 		}
+		d.Write(door.CRNL)
 	}
-	d.Write(door.CRNL)
 
 }