Skip to content

Instantly share code, notes, and snippets.

@ahomu
Last active September 7, 2016 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahomu/b33b71fcf3e44d58a8f1cc32d6387494 to your computer and use it in GitHub Desktop.
Save ahomu/b33b71fcf3e44d58a8f1cc32d6387494 to your computer and use it in GitHub Desktop.
_人人人人人_ > 突然の死 <  ̄Y^Y^Y^Y^Y ̄
package main
import (
"flag"
"fmt"
"math"
"os"
"strings"
)
func main() {
flag.Parse()
if flag.NArg() < 1 {
fmt.Fprintf(os.Stderr, "Usage: %v \"突然の死\"\n", os.Args[0])
os.Exit(1)
}
words := flag.Args()[0]
var width float32
for _, v := range words {
if len(string(v)) < 3 {
width += 0.5
} else {
width++
}
}
count := int(math.Ceil(float64(width)))
fmt.Printf("_人人%v_\n> %v <\n ̄Y%v ̄",
strings.Repeat("人", count),
words,
strings.Repeat("^Y", count),
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment