Giter Site home page Giter Site logo

euridice's Introduction

Coveralls PyPI-Server Twitter Project generated with PyScaffold

Euridice

Just a personal project to refresh my django skills.

euridice's People

Contributors

elcubonegro avatar

Watchers

 avatar

euridice's Issues

Variables and Types in Scala

var a : Int = 1
var b : Int = 2
var c : Int = a + b
$ c: Int = 3

val d : Int = 4
d = 1
$ :12: error: reasignment on val

All valuest must be declared, only traits and abstract classes can have declared but undefined members.

val x = {
| val a : Int = 500
| val b : Int = 400
| a + b
}

x : Int = 900


Existen inicializaciones "perezosas", lo que significa que van a ser asignadas unicamente cuando sean usadas, representa un espacio asignado en la memoria a ser utilizado.

lazy val x = 500
$ x:

Control structures in Scala

Este proyecto te obligará a utilizar estructuras de control como if, else, match, y posiblemente bucles (while o for)

Requisitos Básicos:

El programa debe saludar al usuario con un mensaje amigable (el componente "Hello World").
El usuario debe poder ingresar una cantidad y la unidad de medida original (por ejemplo, 10 metros).
El usuario debe poder seleccionar la unidad de medida a la que desea convertir (por ejemplo, pies).
El programa debe realizar la conversión y mostrar el resultado al usuario.
Sugerencias para Estructuras de Control:

if, else if, else: Utilízalos para determinar la conversión a realizar basándote en las unidades de medida ingresadas por el usuario.
match (opcional): Si te sientes cómodo, puedes usar match como una alternativa más concisa a múltiples if y else if.

OOP in Scala

Defining Classes

In Scala, we can define a class with the class keyword:
class Bread

After the class is defined, we can create an object of that class with the new keyword:
val whiteBread = new Bread

To make a class more meaningful, we can add fields to the class. We can define a field in a class [using var or val], like defining a variable:

class Bread {
  val name: String = "white"
  var weight: Int = 1
}

And then we can access the fields directly from the object we created:

val whiteBread = new Bread
assert(whiteBread.name === "white")
assert(whiteBread.weight === 1)

We can modify the weight as it’s a mutable object:

whiteBread.weight = 2
assert(whiteBread.weight === 2)

Constructors.

A constructor is used to assign values in a class to be used later in the fields or methods of the class. We can also assign a default value in the constructor definition:

class Bread(breadName: String = "white") {
  val name: String = breadName
}

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.