mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
struct capitalization: fix the rest of tests
This commit is contained in:
parent
ed93185cb7
commit
d482b1f824
@ -238,6 +238,7 @@ fn (v mut V) compile() {
|
|||||||
println('all .v files:')
|
println('all .v files:')
|
||||||
println(v.files)
|
println(v.files)
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if v.pref.is_debug {
|
if v.pref.is_debug {
|
||||||
println('\nparsers:')
|
println('\nparsers:')
|
||||||
for q in v.parsers {
|
for q in v.parsers {
|
||||||
@ -248,6 +249,7 @@ fn (v mut V) compile() {
|
|||||||
println(q)
|
println(q)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// First pass (declarations)
|
// First pass (declarations)
|
||||||
for file in v.files {
|
for file in v.files {
|
||||||
for i, p in v.parsers {
|
for i, p in v.parsers {
|
||||||
|
@ -10,7 +10,7 @@ const (GDesc = ' The object of Roulette is to pick the number where the spinnin
|
|||||||
Otherwise, you will lose your bet.\n')
|
Otherwise, you will lose your bet.\n')
|
||||||
const (Odd = 'Red' Even = 'Black')
|
const (Odd = 'Red' Even = 'Black')
|
||||||
|
|
||||||
struct options {
|
struct Options {
|
||||||
long_opt string
|
long_opt string
|
||||||
short_opt string
|
short_opt string
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ fn display_help() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn option_parser() bool {
|
fn option_parser() bool {
|
||||||
help := options{'--help', '-h'}
|
help := Options{'--help', '-h'}
|
||||||
for i := 0; i < os.args.len; i++ {
|
for i := 0; i < os.args.len; i++ {
|
||||||
if os.args[i]== help.long_opt || os.args[i]== help.short_opt {
|
if os.args[i]== help.long_opt || os.args[i]== help.short_opt {
|
||||||
display_help()
|
display_help()
|
||||||
@ -88,7 +88,7 @@ fn get_bet(money int) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn run_wheel(bet_nbr int, _bet int) int {
|
fn run_wheel(bet_nbr int, _bet int) int {
|
||||||
mut bet := _bet
|
mut bet := _bet
|
||||||
rand.seed(time.now().uni)
|
rand.seed(time.now().uni)
|
||||||
winning_nbr := rand.next(50)
|
winning_nbr := rand.next(50)
|
||||||
print('Roulette Wheel spinning... and stops on the number $winning_nbr which is a ')
|
print('Roulette Wheel spinning... and stops on the number $winning_nbr which is a ')
|
||||||
@ -115,7 +115,7 @@ fn is_broke(money int) bool {
|
|||||||
println('You\'broke, the game is over..')
|
println('You\'broke, the game is over..')
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
quit := options{'yes', 'y'}
|
quit := Options{'yes', 'y'}
|
||||||
println('You\'ve $money V. Do you want to quit the casino with your winnings? (y/n)')
|
println('You\'ve $money V. Do you want to quit the casino with your winnings? (y/n)')
|
||||||
line := os.get_line().trim_space().to_lower()
|
line := os.get_line().trim_space().to_lower()
|
||||||
if line== quit.long_opt || line== quit.short_opt {
|
if line== quit.long_opt || line== quit.short_opt {
|
||||||
|
Loading…
Reference in New Issue
Block a user