Created
September 26, 2013 21:01
-
-
Save go-ive/6720503 to your computer and use it in GitHub Desktop.
Demo for a reddit post: http://www.reddit.com/r/learnprogramming/comments/1n6okj/new_to_programming_how_would_you_construct_this/
This file contains 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 ( | |
"fmt" | |
"flag" | |
) | |
func main(){ | |
tempMorning := flag.Int("morning", 60, "Temperature in the morning.") | |
tempAfternoon := flag.Int("afternoon", 75, "Temperature in the afternoon.") | |
flag.Parse() | |
if *tempAfternoon > 75 && *tempMorning < 60 { | |
fmt.Println("It is fall.") | |
} else { | |
fmt.Println("It is some other season.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment