zurück   Startseite   Blog Buchregal Buchregal, eBooks Twitter E-Mail

 

Maya calendar and go

package main

import ("fmt"
"bufio"
"os"
"time"
//"strings"
)

func Recursive(number int) int {
 
		if number >=2020 {
			fmt.Println(number);
			return number
		} else {
			fmt.Println(number);
		}
		  return Recursive(number+52)
  
}
func readword(ch chan string) {
    fmt.Println("Type a word, then hit Enter.")
    var word string
    fmt.Scanf("%s", &word)
    ch <- word
}
 

func main() {
	months := []string{"Pop", "Uo", "Zip", "Zotz","Zec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"}
	var cMonth, mMonth int
	p := fmt.Println
	
	reader := bufio.NewReader(os.Stdin)
	fmt.Print("Enter text: ")
	text, _ := reader.ReadString('\n')
	p(text)
	// date input
	//a:=strings.Split(text,".")
		// p(a[1])
 
	now := time.Now()
    p(now)
	b:=now.YearDay()
	p("YearDay: ", b)
		cMonth =b%20
		mMonth = ((b-cMonth)/20)-1
		
	p(cMonth-1," ",months[mMonth])
	
	// 52 years list
    // answer := Recursive(-3114)
    // fmt.Printf("Recursive: %d\n", answer)
}

 

 

25. März 2019     | go language

zurück

 

     

Startseite | Impressum | Datenschutz