Coder Social home page Coder Social logo

kotlin-polytech / kotlinasfirst Goto Github PK

View Code? Open in Web Editor NEW
74.0 13.0 116.0 1.39 MB

Задачи для онлайн-курса "Котлин как первый язык программирования"

License: Creative Commons Attribution Share Alike 4.0 International

Kotlin 100.00%

kotlinasfirst's Introduction

Котлин как первый язык программирования

Решите приведённые в проекте задачи, чтобы научиться программировать на Котлине. Сейчас доступны двенадцать групп задач (уроков).

  1. Простые функции.
  2. Ветвления.
  3. Циклы.
  4. Работа со списками.
  5. Работа с ассоциативными массивами (Maps).
  6. Разбор строк.
  7. Работа с файлами.
  8. Простые классы.
  9. Сложные классы на примере матриц.
  10. Доп. главы (синтаксический разбор, Kotlin DSL).
  11. Классы с арифметическими операциями.
  12. Классы-контейнеры.

В директории tutorial имеется учебное пособие по Котлину на русском языке. Оно содержит введение и девять разделов, каждый из которых относится к соотвествующему уроку в проекте. Разделы 11 и 12 находятся в разработке. Также пособие включает дополнительные разделы, не включающие задач:

  • 4.5 (про организацию памяти)
  • 6.5 (про регулярные выражения)
  • 8.5 (про графы и графовые алгоритмы)

Список использованных источников

Формулировки многих задач взяты из следующей книги:

  • А. Юркин. Задачник по программированию. СПб.: Питер, 2002. - 192 с. ISBN 5-318-00399-0.

Полезные ссылки

Материалы по языку Kotlin:

Видео-курс (Coursera):

Руководство по настройке среды программирования:

Задачи по алгоритмам (Java/Kotlin):

kotlinasfirst's People

Contributors

abdullinam avatar belyaev-mikhail avatar fembiba avatar gagarski avatar ice-phoenix avatar lancelote avatar maximpetrov avatar mglukhikh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kotlinasfirst's Issues

Think about evaluation system in 2017

In 2016 we had some issues about this. In particular, people tend to solve a lot of tasks in first lessons and then try to solve 1-2 easiest in second half.

Add leading zeroes to lesson numbers

Most directory viewers now sort the lessons as following:

  • lesson1
  • lesson10
  • lesson2
  • lesson3
  • ...
  • lesson9

which is a bit frustrating.

Adding leading zeroes would solve this problem:

  • lesson01
  • lesson02
  • lesson03
  • ...
  • lesson09
  • lesson10

lesson5.task1.plusMinus: consider allowing signed numbers.

Currently, to strictly check input string for correctness a student has to perform two checks:

  • try to call toInt() on number (to check format and integer range) and throw IllegalArgumentException if NumberFormatException happens;
  • match with regex (something like [0-9]+) (to forbid signed numbers (+1, -7 etc.)), throw IAE if number does not match this regex.

Most students usually do not do at least one of those and it is rarely noted by teachers. A possible bug can only be found by random tests in some rare cases.

This can be solved two ways:

  • provide some non random tests (like 1 + +3, 12 + -2, 121212121212121212121 + 3). (I'm not sure if JUnit's assertThrows will allow us to check if IAE but not NFE is thrown)
  • consider the first two examples correct inputs (and everything accepted by .toInt()). (This way we have to update the model implementation since it tries to strictly check input string).

Kotlin Algorithm Club

Здравствуйте,
Я поддерживаю небольшой проект, посвящённый алгоритмам и структурам данных в kotlin. Возможно, он будет полезен в вашем курсе.
Ваш бывший студент =)

chapter04: лямбды

Нужно пояснение, почему параметр-лямбда не заключён в круглые скобки и когда это возможно.

Move task to lesson 3

Гипотеза Коллатца

/**
* Рекуррентная последовательность чисел задана следующим образом:
*
*   ЕСЛИ (X четное)
*     Xслед = X /2
*   ИНАЧЕ
*     Xслед = 3 * X + 1
*
* например
*   15 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 4 2 1 4 2 1 ...
* Данная последовательность рано или поздно встречает X == 1.
* Написать функцию, которая находит, сколько шагов требуется для
* этого для какого-либо начального X > 0.
*
* Имя функции и тип результата функции предложить самостоятельно.
*
* Кроме функции, следует написать тесты, 
* подтверждающие её работоспособность.
*/
fun myFun(x: Int): Any = TODO()

dateStrToDigit/dateDigitToStr

Specify that day should be correct (e.g. 31.02.2001 and 29.02.2001 should be incorrect). Maybe enforce that with new task in lesson2 (daysInMonth(month: Int, year: Int))

Fix mostExpensive task

First, clarify that price can be without dot. Also, diagnostic message in tests should be fixed,

Migrate from Maven to Gradle

It's controversial but otherwise it's unclear how can we use inspection plugin. Some part of this work is already done in gradle branch.

Provide better reference list

May be it's a good idea to have one large reference list in README (and at some place of Coursera course(s)), and one shorter reference list per tutorial chapter.

Lesson 6: some geometry data classes are broken

  • Currently Line equality is broken. Point(α * x, α * y), angle + π * n for ∀α ∈ ℝ, ∀n ∈ ℤ represent the same line.
    k*x + b might work better but still isn't perfect ((-Inf) * x + b and (+Inf) * x + b represent the same line)
  • Triangle and Segment equality comparison should be independent from the order of the points (for Segment it matters in diameter tests).

clarify transliterate

What should we do with case in dictionary values when they are non-lower case? Should we call .capitalize() or .toLowerCase().capitalize()?

chapter01: дискриминант

Для примера их использования рассмотрим решение задачи вычисления дискриминанта квадратного уравнения. Математически он равен квадратному корню из b2-4ac.

Дискриминант равен b2-4ac (не корню из), а при вычислении корней используется корень из дискриминанта.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.