mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
992 B
43 lines
992 B
5 years ago
|
package main
|
||
5 years ago
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"strconv"
|
||
|
|
||
5 years ago
|
"../lib"
|
||
5 years ago
|
)
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
operatorsTable := []string{"+", "-", "*", "/", "%"}
|
||
|
|
||
|
table := []string{}
|
||
|
|
||
|
for i := 0; i < 4; i++ {
|
||
5 years ago
|
firstArg := strconv.Itoa(lib.RandIntBetween(-1000, 1000))
|
||
|
secondArg := strconv.Itoa(lib.RandIntBetween(0, 1000))
|
||
5 years ago
|
|
||
|
for _, operator := range operatorsTable {
|
||
|
table = append(table, firstArg+" "+operator+" "+secondArg)
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
table = append(table, "1 + 1")
|
||
|
table = append(table, "hello + 1")
|
||
|
table = append(table, "1 p 1")
|
||
|
table = append(table, "1 / 0")
|
||
|
table = append(table, "1 # 1")
|
||
|
table = append(table, "1 % 0")
|
||
|
table = append(table, "1 * 1")
|
||
|
table = append(table, "1argument")
|
||
|
table = append(table, "2 arguments")
|
||
|
table = append(table, "4 arguments so invalid")
|
||
|
table = append(table, "9223372036854775807 + 1")
|
||
|
table = append(table, "9223372036854775809 - 3")
|
||
|
table = append(table, "9223372036854775807 * 3")
|
||
|
for _, s := range table {
|
||
5 years ago
|
lib.ChallengeMain("doop", strings.Fields(s)...)
|
||
5 years ago
|
}
|
||
|
}
|