Last active
September 7, 2016 16:10
-
-
Save ahomu/b33b71fcf3e44d58a8f1cc32d6387494 to your computer and use it in GitHub Desktop.
_人人人人人_ > 突然の死 <  ̄Y^Y^Y^Y^Y ̄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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