generated from cs130-w22/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-demo prepwork. Format dates nicely, add two example submissions (#85
- Loading branch information
1 parent
23555f6
commit 7906d7a
Showing
7 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
// Example of a submission to our class! | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"strconv" | ||
"strings" | ||
) | ||
|
||
func main() { | ||
test_str := "1, Doxa, Theo, gia, ola, ta, pragmata, incorrect" | ||
fmt.Println(strings.Split(test_str, ",")[0:]) | ||
|
||
argnum := 0 | ||
if len(os.Args) > 1 { | ||
argnum, _ = strconv.Atoi(os.Args[1]) | ||
_, err := strconv.Atoi(os.Args[1]) | ||
if err != nil { | ||
print(err) | ||
return | ||
} | ||
} | ||
|
||
if a := argnum; a == 100 { | ||
fmt.Println("2 Definition worked") | ||
} else { | ||
fmt.Println("2 Definition failed") | ||
} | ||
|
||
text := "NAME" | ||
if text[4:] == "" { | ||
fmt.Println("3 Empty") | ||
} | ||
} |
Binary file not shown.
File renamed without changes.
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
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
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