kotlin-polytech / kotlinasfirst Goto Github PK
View Code? Open in Web Editor NEWЗадачи для онлайн-курса "Котлин как первый язык программирования"
License: Creative Commons Attribution Share Alike 4.0 International
Задачи для онлайн-курса "Котлин как первый язык программирования"
License: Creative Commons Attribution Share Alike 4.0 International
Currently, to strictly check input string for correctness a student has to perform two checks:
toInt()
on number (to check format and integer range) and throw IllegalArgumentException
if NumberFormatException
happens;[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:
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).toInt()
). (This way we have to update the model implementation since it tries to strictly check input string).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.
First, clarify that price can be without dot. Also, diagnostic message in tests should be fixed,
After release
Most directory viewers now sort the lessons as following:
which is a bit frustrating.
Adding leading zeroes would solve this problem:
This will help to stabilize tests, and in these tasks Double adds not so much to understanding something
It's useful in general, important for some file tasks (lesson 8), important for examination.
См. один из последних коммитов Кирилла
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)
)
Should we rotate matrix in-place or return a copy?
What should we do with case in dictionary
values when they are non-lower case? Should we call .capitalize()
or .toLowerCase().capitalize()
?
Нужно пояснение, почему параметр-лямбда не заключён в круглые скобки и когда это возможно.
To be able to compile a lesson or a task regardless of other lessons / tasks current state
hello
inside hello42
a word? (Not it's unclear if we should treat it as a word or just ignore it).Ё
letter, hello42
case etc.)And think a little bit about this configuration. For example, "LoopToCallChain" must be disabled.
Clarify that divisros in factorizeToString
should be in ascending order.
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).Too much people solve it wrong in the first attempt
In Kotlin 1.2+, pow
is an extension and called as x.pow(y)
Reasons:
Also better to wait until the beginning of September
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.
They should sort the function results
Lesson should include task stubs, tests, and tutorial chapter. Probably it should have number 9, later we will discuss should we remove current lesson 7 or leave it as optional.
These tasks now can be solved using one line with standard library function which is probably not what we expect from students here.
It currently has "no highlighting, fix only" status in 1.1.4 by default
Здравствуйте,
Я поддерживаю небольшой проект, посвящённый алгоритмам и структурам данных в kotlin. Возможно, он будет полезен в вашем курсе.
Ваш бывший студент =)
https://github.com/Kotlin-Polytech/KotlinAsFirst/blob/master/src/lesson6/task1/Geometry.kt#L120
Assertions are disabled in JVM by default and require
ing is more correct.
Гипотеза Коллатца
/**
* Рекуррентная последовательность чисел задана следующим образом:
*
* ЕСЛИ (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()
Something like Kotoed2017
. Better to wait until 04-09-2017 or something like this.
Для примера их использования рассмотрим решение задачи вычисления дискриминанта квадратного уравнения. Математически он равен квадратному корню из b2-4ac.
Дискриминант равен b2-4ac (не корню из), а при вычислении корней используется корень из дискриминанта.
May be, together with algorithm lessons, it will lead to migration to another repo, like KotoedCourse
or so.
They had RC2 on July 30, soon we can expect release version
See JavaKotlinASD repo.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.