Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- button
- Android
- 자바스크립트
- React
- 구글맵스
- 안드로이드
- 리액트
- fragment
- Kotlin
- SpringBoot
- 랜덤번호
- stylesheet
- scrollview
- Javscript
- 코틀린
- 오버라이딩
- Linux
- JavaScript
- GoogleMaps
- array
- 스프링부트
- TextView
- nodejs
- Hook
- npm
- Java
- JS
- TypeScript
- RecyclerView
- 랜덤넘버
Archives
- Today
- Total
목록kotlin #if #while #random (1)
타닥타닥 개발자의 일상
kotlin으로 while, if, random 이용해서 랜덤 가위바위보 게임 만들기
fun main(args: Array) { var userNum: Int //유저가 선택한 가위/바위/보 값 var comNum: Int //컴퓨터의 가위/바위/보 값 var win: Int //승리 횟수 var lose: Int //패배 횟수 var draw: Int //무승부 횟수 var result: Int //결과 값 win = 0.also { draw = it }.also { lose = it } // win = lose = draw =0 println("가위바위보 게임입니다.") while (true) { //while문 시작! println("start game >>>") //random comNum = (Math.random() * 3).toInt() //0~2 사이 값 //user inp..
코딩 기록/Kotlin
2022. 1. 25. 17:51