/dev-venture

Atividades realizadas durante o bootcamp Dev Venture

Dev-Venture - Registros

Atividades realizadas durante o bootcamp Dev Venture

Dev-Venture

  • Atividades

    • Hackerrank

      • Soma dos valores de um array

        fun simpleArraySum(ar: Array<Int>): Int = ar.sum()
    • Koans

      • Introdução
        • Named arguments

          fun joinOptions(options: Collection<String>) =
          options.joinToString(prefix= "[", postfix = "]")
        • Default arguments

          fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false) =
          (if (toUpperCase) name.uppercase() else name) + number
        • Triple-quoted strings

          val tripleQuotedString = """
          #question = "$question"
          #answer = $answer""".trimMargin("#")
        • String templates

          fun getPattern(): String = """\d{2} $month \d{4}"""
        • Nullable types

          fun sendMessageToClient(client: Client?, message: String?, mailer: Mailer) {
              val personalInfo = client?.personalInfo
              val email = personalInfo?.email
             
              if(email == null || message == null) return
              
              mailer.sendMessage(email, message)
          }
        • Nothing type

          fun failWithWrongAge(age: Int?): Nothing  {
          		throw IllegalArgumentException("Wrong age: $age")
          }
        • Lambdas

          fun containsEven(collection: Collection<Int>): Boolean =
                  collection.any { it % 2 == 0 }
  • Desafios

    Aplicativo Jogue Os Dados

    Aplicativo Layout Calculadora