funny file actually hosted on github

This commit is contained in:
echo 2022-09-09 19:39:19 +04:30
parent 3a5de14ab3
commit b2e4003ef0

74
main.go
View file

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"math/rand"
"os" "os"
"os/exec" "os/exec"
"strconv" "strconv"
@ -12,11 +13,57 @@ import (
var isuwuified bool = true var isuwuified bool = true
var tempbool bool var tempbool bool
func cprint(input string, newline bool) { func cprint(input string, newline bool, uwuoverwrite bool) {
if newline == false { endings := [15]string{
fmt.Print(input) "owo",
"UwU",
">w<",
"^w^",
"●w●",
"☆w☆",
"𝗨𝘄𝗨",
"(´꒳`)",
"♥(。U ω U。)",
"(˘ε˘)",
"( ˘ᴗ˘ )",
"(*ฅ́˘ฅ̀*)",
"*screams*",
"*twearks*",
"*sweats*",
}
ninput := ""
if isuwuified && !uwuoverwrite {
bruh := strings.Split(input, " ")
for _, word := range bruh {
if word == "" {
continue
}
word = strings.ReplaceAll(word, "r", "w")
word = strings.ReplaceAll(word, "i", "iy")
word = strings.ReplaceAll(word, "l", "w")
if strings.HasSuffix(word, "!") {
word = word[0:len(word)-1] + "1!11!1"
}
if strings.Contains(word, "u") && !strings.Contains(word, "uwu") && !strings.Contains(word, "owo") {
word = strings.ReplaceAll(word, "u", "uwu")
}
ninput += word + " "
}
if rand.Intn(5-1)+1 == 2 {
ninput += endings[rand.Intn(len(endings))]
}
} else { } else {
fmt.Print(input + "\n") ninput = input
}
if newline == false {
fmt.Print(ninput)
} else {
fmt.Print(ninput + "\n")
} }
} }
@ -45,10 +92,10 @@ among`)
declr := w[0] declr := w[0]
inf := w[1] inf := w[1]
if declr == "nn-prin" { if declr == "nn-prin" {
cprint(strings.Join(w[1:], " "), false) cprint(strings.Join(w[1:], " "), false, false)
} }
if declr == "prin" { if declr == "prin" {
cprint(strings.Join(w[1:], " "), true) cprint(strings.Join(w[1:], " "), true, false)
} }
if declr == "nn-info" || declr == "info" { if declr == "nn-info" || declr == "info" {
if declr == "info" { if declr == "info" {
@ -57,9 +104,12 @@ among`)
tempbool = false tempbool = false
} }
if inf == "username" { if inf == "username" {
cprint(getUsername(), tempbool) cprint(getUsername(), tempbool, false)
} else if inf == "hostname" { } else if inf == "hostname" {
cprint(getHostname(), tempbool) cprint(getHostname(), tempbool, false)
} else if inf == "uptime" {
among, _ := strconv.Atoi(getUptime())
cprint(formatTime(among), tempbool, true)
} }
} }
} }
@ -123,10 +173,9 @@ func getKernel() string {
return string(kernel) return string(kernel)
} }
func getUptime() string { func getUptime() string {
cmd := exec.Command("cat", "/proc/uptime") content, _ := os.ReadFile("/proc/uptime")
uptime, _ := cmd.Output() return (string(content[0:strings.Index(string(content), ".")]))
intup, _ := strconv.Atoi(string(uptime[:strings.Count(string(uptime), ".")+3]))
return formatTime(intup)
} }
func getPackages() { func getPackages() {
} }
@ -227,6 +276,7 @@ func getColorPalette() {
func main() { func main() {
handleArgs() handleArgs()
handleConfig() handleConfig()
//if isuwuified { //if isuwuified {
// fmt.Print("\n shit will be uwuified\n") // fmt.Print("\n shit will be uwuified\n")
//} else { //} else {