Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gradle/7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/main/kotlin/Bonus-HW.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
fun main() {

"."

for (row in 1..readLine()!!.toInt()) {
for (col in 1..row){
print("1*$col ")
}
println(" ")
}

}
fun testArray( ): Array<Array<Int>>{
val numberArray = Array(5) {
Array(5) { 0 }
}
for(row in 0..4){
for (col in 0..row){
numberArray[row][col]=1
}
}
return numberArray
}
13 changes: 11 additions & 2 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
fun main(args: Array<String>) {
fun main() {
"."
// part |
val firstMap = mapOf<Int,Char>(0 to 'a',1 to 'b',2 to 'c',3 to 'd' ).toMutableMap() // creating map with 4 elements
firstMap += 4 to 'e' // adding new element
firstMap[0]= 'g' // editing the first key
firstMap -= 4 // remove the key and its entry


// your code here


// part ||
val kosaList = listOf("rakan","mohammed","sultan")
kosaList.mapIndexed{index, item -> index.toString() to item } // puting numbered keys to the list and map it
val newMAp = kosaList.mapIndexed{index, item -> index.toString() to item }.toMap()

}