File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
exercises/04_primitive_types
solutions/04_primitive_types Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
- // Create an array with at least 100 elements in it where the ??? is.
2
-
3
1
fn main ( ) {
4
- let a = ???
2
+ // TODO: Create an array with at least 100 elements in it where the ??? is.
3
+ // let a = ???
5
4
6
5
if a. len ( ) >= 100 {
7
6
println ! ( "Wow, that's a big array!" ) ;
8
7
} else {
9
8
println ! ( "Meh, I eat arrays like that for breakfast." ) ;
10
- panic ! ( "Array not big enough, more elements needed" )
9
+ panic ! ( "Array not big enough, more elements needed" ) ;
11
10
}
12
11
}
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ name = "primitive_types3"
250
250
dir = " 04_primitive_types"
251
251
test = false
252
252
hint = """
253
- There's a shorthand to initialize Arrays with a certain size that does not
253
+ There's a shorthand to initialize arrays with a certain size that doesn't
254
254
require you to type in 100 items (but you certainly can if you want!).
255
255
256
256
For example, you can do:
Original file line number Diff line number Diff line change 1
- // Solutions will be available before the stable release. Thank you for testing the beta version 🥰
1
+ fn main ( ) {
2
+ // An array with 100 elements of the value 42.
3
+ let a = [ 42 ; 100 ] ;
4
+
5
+ if a. len ( ) >= 100 {
6
+ println ! ( "Wow, that's a big array!" ) ;
7
+ } else {
8
+ println ! ( "Meh, I eat arrays like that for breakfast." ) ;
9
+ panic ! ( "Array not big enough, more elements needed" ) ;
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments