diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml
new file mode 100644
index 00000000..9b915e85
--- /dev/null
+++ b/.idea/caches/deviceStreaming.xml
@@ -0,0 +1,558 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 9c8e7400..f03c9487 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/src/main/kotlin/Archive.kt b/src/main/kotlin/Archive.kt
new file mode 100644
index 00000000..46a1ee36
--- /dev/null
+++ b/src/main/kotlin/Archive.kt
@@ -0,0 +1,13 @@
+
+class Archive (val name: String) {
+ val notes = mutableListOf()
+}
+
+
+
+
+
+
+
+
+
diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt
index aade54c5..73e59211 100644
--- a/src/main/kotlin/Main.kt
+++ b/src/main/kotlin/Main.kt
@@ -1,3 +1,69 @@
+import java.util.Scanner
+import kotlin.system.exitProcess
+
+val archives = mutableListOf()
+
+fun showMenu(){
+ val menu = MenuNavi("Список архивов")
+ menu.menuItems.add("Создать архив" to {createArchive()})
+ archives.forEachIndexed {index, archive ->
+ menu.menuItems.add(archive.name to {showArchMenu(index)})
+ }
+ menu.funMenu{ exitProcess(0) }
+}
+
+fun createArchive() {
+ println("Введите имя архива")
+ var name = Scanner(System.`in`).nextLine()
+ while (name.trim().isEmpty()) {
+ println("Имя архива должно содержать хотя бы 1 символ")
+ name = Scanner(System.`in`).nextLine()
+ }
+ archives.add(Archive(name))
+ showMenu()
+}
+
+fun showArchMenu(archIndex: Int) {
+ val archive = archives[archIndex]
+ val menu = MenuNavi("Список заметок")
+ menu.menuItems.add("Создать заметку" to {createNote(archive)})
+ archive.notes.forEachIndexed { index, note ->
+ menu.menuItems.add(note.name to { showNoteMenu(archive, index) })
+ }
+ menu.funMenu{showMenu()}
+}
+
+fun createNote(archive: Archive) {
+ println("Введите имя заметки")
+ var name = Scanner(System.`in`).nextLine()
+ while (name.trim().isEmpty()) {
+ println("Имя заметки должно содержать хотя бы 1 символ")
+ name = Scanner(System.`in`).nextLine()
+ }
+
+println("Введите текст заметки:")
+ var text = Scanner(System.`in`).nextLine()
+ while (text.trim().isEmpty()) {
+ println("В заметке пусто, повторите ввод")
+ text = Scanner(System.`in`).nextLine()
+}
+
+archive.notes.add(Note(name, text))
+println("Заметка '$name' создана.")
+showArchMenu(archives.indexOf(archive))
+}
+
+fun showNoteMenu(archive: Archive, noteIndex: Int) {
+ val note = archive.notes[noteIndex]
+ println("Заметка: ${note.name}")
+ println("Текст: ${note.text}")
+ println("Для возврата нажмите Enter или введите любой символ")
+ readlnOrNull()
+ showArchMenu(archives.indexOf(archive))
+}
+
fun main(args: Array) {
- println("Hello World!")
+ println("Приложение Заметки")
+ showMenu()
+
}
\ No newline at end of file
diff --git a/src/main/kotlin/MenuNavi.kt b/src/main/kotlin/MenuNavi.kt
new file mode 100644
index 00000000..b3d3a549
--- /dev/null
+++ b/src/main/kotlin/MenuNavi.kt
@@ -0,0 +1,29 @@
+import java.util.Scanner
+
+class MenuNavi(val name: String) {
+
+ val menuItems = mutableListOf Unit>>()
+
+ fun funMenu(exit:() -> Unit = {}){
+ while (true) {
+ println("$name:")
+
+ menuItems.forEachIndexed { index, pair ->
+ println("$index. ${pair.first}")
+ }
+ if (menuItems.size !== 0) println("${menuItems.size}. Выход") else println("1. Выход")
+
+ val i = Scanner(System.`in`).nextLine().toIntOrNull()
+ if (i != null) {
+ if (i < menuItems.size) {
+ menuItems[i].second()
+ return}
+ }
+ if (i == menuItems.size) {
+ exit()
+ } else {
+ println("Неверный ввод, попробуйте снова")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/Note.kt b/src/main/kotlin/Note.kt
new file mode 100644
index 00000000..4c90aed1
--- /dev/null
+++ b/src/main/kotlin/Note.kt
@@ -0,0 +1,6 @@
+
+class Note (val name: String, text: String?) {
+ var text: String = text.toString()
+}
+
+