시작하기무료로 시작하기

An array, all at once

In the previous exercises, you created and parameterized an array, then initialized it separately.

In this exercise, you'll experience performing all of these steps at once. The card variables you need are already defined.

이 연습은 강의의 일부입니다

Introduction to Scala

강의 보기

연습 안내

  • Create an array named hands.
  • Initialize the first player's hand to tenClubs + fourDiamonds.
  • Initialize the second player's hand to nineSpades + nineHearts.
  • Initialize the third player's hand to twoClubs + threeSpades.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

// Create, parameterize, and initialize an array for a round of Twenty-One
val ___ = ___(___ + ___,
              ___ + ___,
              ___ + ___)
코드 편집 및 실행