Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kotlin-study
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
이연주
kotlin-study
Commits
8ed4d8e5
Commit
8ed4d8e5
authored
5 years ago
by
reeplay
Browse files
Options
Downloads
Patches
Plain Diff
add more contents to AboutKotlin_2
parent
824cb3a6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
documents/AboutKotlin_2.md
+39
-3
39 additions, 3 deletions
documents/AboutKotlin_2.md
documents/captures/TextExpression.png
+0
-0
0 additions, 0 deletions
documents/captures/TextExpression.png
practice/NyetHack/.idea/workspace.xml
+4
-2
4 additions, 2 deletions
practice/NyetHack/.idea/workspace.xml
with
43 additions
and
5 deletions
documents/AboutKotlin_2.md
+
39
−
3
View file @
8ed4d8e5
...
...
@@ -52,7 +52,7 @@ fun main(){
**downTo
함수
**
**downTo
<u>함수</u>
**
감소되는 연속된 값 범위 생성한다.
...
...
@@ -66,7 +66,7 @@ fun main(){
**until
함수
**
**until
<u>함수</u>
**
끝값이 정확히 지정되지 않을 때 사용된다. until로 지정된 범위의 상한값은 제외시킨 범위를 생선한다.
...
...
@@ -87,7 +87,25 @@ fun main(){
#### 기타
#### 2. when 표현식
when 표현식은
<u>
괄호 안에 있는 인자
</u>
(argument)와
<u>
중괄호 안에서 지정 지정한 조건값
</u>
들을 기준으로 == 비교 연산자로 두 값을 각각 비교한다.
```
kotlin
fun
main
(){
val
healthStatus
=
when
(
healthPoints
){
100
//-> "최상의 상태"
in
50
..
99
//-> "약간의 찰과상 존재"
else
->
"최악의 상태"
}
println
(
userName
+
" "
+
healthStatus
)
}
```
코
*드 해석: →(화살표)의 왼쪽부분이 healthPoints 변수의 값이 될 수 있는 범위를 나타낸다. 즉, **in 키워드**를 통해서 healthPoints가 해당 범위에 속하는지 검사한다.*
#### 3. 기타
*
비교연산자
...
...
@@ -151,5 +169,23 @@ fun main(){
*
문자열 템플릿(string template)
'
**$ + 변수**
'로 작성하여 문자열 안에 변수의 값을 포함시켜 출력할 수 있다.
```
kotlin
fun
main
(){
val
userName
=
"Joylish"
var
healthPoints
=
10
println
(
"$name의 건강점수는 $healthPoints이다."
)
}
```
**(+a) 문자 표현식**
문자열 내부에서 '
**$ + 중괄호'**
를 활용해서 중괄호 안에 있는 표현식을 실행한 후 그 결과를 문자열에 삽입한다.

This diff is collapsed.
Click to expand it.
documents/captures/TextExpression.png
0 → 100644
+
0
−
0
View file @
8ed4d8e5
12.3 KiB
This diff is collapsed.
Click to expand it.
practice/NyetHack/.idea/workspace.xml
+
4
−
2
View file @
8ed4d8e5
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"c8fe5052-ef54-4670-996b-63e6701eba50"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"c8fe5052-ef54-4670-996b-63e6701eba50"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/../../documents/AboutKotlin_2.md"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../../documents/AboutKotlin_2.md"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/out/"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
...
...
@@ -81,6 +83,7 @@
</panes>
</component>
<component
name=
"PropertiesComponent"
>
<property
name=
"SHARE_PROJECT_CONFIGURATION_FILES"
value=
"true"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"configurable.group.appearance"
/>
</component>
...
...
@@ -131,7 +134,6 @@
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"762"
y=
"0"
width=
"781"
height=
"830"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.18307906"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment