일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 42ecole
- c언어
- 플레이그라운드
- 플레이그라운드 문제풀이
- 맥
- 스위프트공부
- binary operator
- ==
- 값올리기
- playgrounds
- string from
- Swift
- ios개발자
- 프로그래머스 문제 풀이
- ios
- ternary operator
- 42에꼴
- html
- ===
- swiftlanguage
- 짝수와 홀수
- !==
- 스위프트
- 이노베이션아카데미
- 두 정수 사이의 합
- 프로그래머스
- unary operator
- 라피신
- 추적하기
- string(from)
Archives
- Today
- Total
minError
Playgrounds [ 7개의 보석 찾기 ] 본문
//1. gemCounter변수를 선언하고 해당 값을 0으로 설정합니다.
var gemCounter = 0
//3. while루프를 사용하여 7개의 모든 보석을 수집할 때까지 수집을 계속하도록 합니다.
while gemCounter < 7 {
while !isBlocked {
//2. 캐릭터가 보석을 수집할 때마다 gemCounter 값을 증가시킵니다.
if isOnGem {
collectGem()
gemCounter = gemCounter + 1
}
moveForward()
}
turnLeft()
turnLeft()
}
'PlayGround > 코딩배우기 2' 카테고리의 다른 글
PlayGrounds [ 동일한 값 확인하기 ] (0) | 2020.02.27 |
---|---|
PlayGrounds [ 3개의 보석, 4개의 스위치 ] (0) | 2020.02.27 |
PlayGrounds [ 값 증가시키기 ] (0) | 2020.02.26 |
PlayGrounds [ 변수 - 값 올리기 ] (0) | 2020.02.25 |
PlayGrounds [ 변수 - 추적하기 ] (0) | 2020.02.25 |
Comments