From 9afd4fd1bd7ea9fb32dd3957c07380d3879da753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=81opusza=C5=84ski?= Date: Wed, 4 Oct 2017 16:15:38 +0200 Subject: [groovy] small fix in iteration over a map --- es-es/groovy-es.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'es-es') diff --git a/es-es/groovy-es.html.markdown b/es-es/groovy-es.html.markdown index 799fc609..262d5e6a 100644 --- a/es-es/groovy-es.html.markdown +++ b/es-es/groovy-es.html.markdown @@ -232,10 +232,12 @@ for (i in array) { // Iterando sobre un mapa def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy'] -x = 0 +x = "" for ( e in map ) { x += e.value + x += " " } +assert x.equals("Roberto Grails Groovy ") /* Operadores -- cgit v1.2.3 From 7d2dcc0df4b85861f7880fcd9299674a7040fff7 Mon Sep 17 00:00:00 2001 From: "J.Juan" <32603609+jjuanhdez@users.noreply.github.com> Date: Sun, 8 Oct 2017 01:05:48 +0200 Subject: Create learnsmallbasic-es.html.markdown --- es-es/learnsmallbasic-es.html.markdown | 132 +++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 es-es/learnsmallbasic-es.html.markdown (limited to 'es-es') diff --git a/es-es/learnsmallbasic-es.html.markdown b/es-es/learnsmallbasic-es.html.markdown new file mode 100644 index 00000000..21208792 --- /dev/null +++ b/es-es/learnsmallbasic-es.html.markdown @@ -0,0 +1,132 @@ +--- +language: SmallBASIC +filename: learnsmallbasic-es.bas +contributors: + - ["Chris Warren-Smith", "http://smallbasic.sourceforge.net"] +translators: + - ["José Juan Hernández García", "http://jjuanhdez.es"] +lang: es-es +--- + +## Acerca de + +SmallBASIC es un intérprete del lenguaje BASIC rápido y fácil de aprender, ideal para cálculos cotidianos, scripts y prototipos. SmallBASIC incluye funciones trigonométricas, matrices y álgebra, un IDE integrado, una potente librería de cadenas de texto, comandos de sistema, sonido y gráficos, junto con una sintaxis de programación estructurada. + +## Desarrollo + +SmallBASIC fue desarrollado originalmente por Nicholas Christopoulos a finales de 1999 para el Palm Pilot. El desarrollo del proyecto ha sido continuado por Chris Warren-Smith desde el año 2005. +Versiones de SmallBASIC se han hecho para una serie dispositivos de mano antiguos, incluyendo Franklin eBookman y el Nokia 770. También se han publicado varias versiones de escritorio basadas en una variedad de kits de herramientas GUI, algunas de las cuales han desaparecido. Las plataformas actualmente soportadas son Linux y Windows basadas en SDL2 y Android basadas en NDK. También está disponible una versión de línea de comandos de escritorio, aunque no suele publicarse en formato binario. +Alrededor de 2008 una gran corporación lanzó un entorno de programación BASIC con un nombre de similar. SmallBASIC no está relacionado con este otro proyecto. + +```SmallBASIC +REM Esto es un comentario +' y esto tambien es un comentario + +REM Imprimir texto +PRINT "hola" +? "? es la abreviatura de PRINT" + +REM Estructuras de control +FOR index = 0 TO 10 STEP 2 + ? "Este es el numero de linea "; index +NEXT +J = 0 +REPEAT + J++ +UNTIL J = 10 +WHILE J > 0 + J-- +WEND + +REM Estructura Select Case +SELECT CASE "Cool" + CASE "null", 1, 2, 3, 4, 5, 6, 7, 8, "Cool", "blah" + CASE "No Cool" + PRINT "Fallo epico" + CASE ELSE + PRINT "Fallo" +END SELECT + +REM Captura de errores con TRY/CATCH +TRY + fn = Freefile + OPEN filename FOR INPUT As #fn +CATCH err + PRINT "No se pudo abrir" +END TRY + +REM Procedimientos y funciones definidas por el usuario +FUNC add2(x, y) + ' variables pueden declararse como locales en el ambito de una SUB o FUNC + LOCAL k + k = "k dejara de existir cuando retorne FUNC" + add2 = x + y +END +PRINT add2(5, 5) + +SUB print_it(it) + PRINT it +END +print_it "IT...." + +REM Visualizacion de lineas y pixeles +At 0, ymax / 2 + txth ("Q") +COLOR 1: ? "sin(x)": +COLOR 8: ? "cos(x)": +COLOR 12: ? "tan(x)" +LINE 0, ymax / 2, xmax, ymax / 2 +FOR i = 0 TO xmax + PSET i, ymax / 2 - SIN(i * 2 * pi / ymax) * ymax / 4 COLOR 1 + PSET i, ymax / 2 - COS(i * 2 * pi / ymax) * ymax / 4 COLOR 8 + PSET i, ymax / 2 - TAN(i * 2 * pi / ymax) * ymax / 4 COLOR 12 +NEXT +SHOWPAGE + +REM SmallBASIC es ideal para experimentar con fractales y otros efectos interesantes +DELAY 3000 +RANDOMIZE +ff = 440.03 +FOR j = 0 TO 20 + r = RND * 1000 % 255 + b = RND * 1000 % 255 + g = RND * 1000 % 255 + c = RGB(r, b, g) + ff += 9.444 + FOR i = 0 TO 25000 + ff += ff + x = MIN(xmax, -x + COS(f * i)) + y = MIN(ymax, -y + SIN(f * i)) + PSET x, y COLOR c + IF (i % 1000 == 0) THEN + SHOWPAGE + fi + NEXT +NEXT j + +REM Para historiadores de computadoras, SmallBASIC puede ejecutar programas +REM encontrados en los primeros libros de computacion y revistas, por ejemplo: +10 LET A = 9 +20 LET B = 7 +30 PRINT A * B +40 PRINT A / B + +REM SmallBASIC también tiene soporte para algunos conceptos modernos como JSON +aa = ARRAY("{\"cat\":{\"name\":\"harry\"},\"pet\":\"true\"}") +IF (ismap(aa) == false) THEN + THROW "no es un mapa" +END IF +PRINT aa + +PAUSE + +``` +## Artículos + +* [Primeros pasos](http://smallbasic.sourceforge.net/?q=node/1573) +* [Bienvenido a SmallBASIC](http://smallbasic.sourceforge.net/?q=node/838) + +## GitHub + +* [Código fuente](https://github.com/smallbasic/SmallBASIC) +* [Reference snapshot](http://smallbasic.github.io/) + -- cgit v1.2.3 From d01e5242e16c522becc1b04f9692d2556f94c4f1 Mon Sep 17 00:00:00 2001 From: Damian Rzeszot Date: Mon, 9 Oct 2017 12:01:15 +0200 Subject: swift | fix style guidelines --- es-es/swift-es.html.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'es-es') diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown index 8f63517a..ea892628 100644 --- a/es-es/swift-es.html.markdown +++ b/es-es/swift-es.html.markdown @@ -446,20 +446,20 @@ if let circle = myEmptyCircle { // Al igual que las clases, pueden contener métodos enum Suit { - case Spades, Hearts, Diamonds, Clubs + case spades, hearts, diamonds, clubs func getIcon() -> String { switch self { - case .Spades: return "♤" - case .Hearts: return "♡" - case .Diamonds: return "♢" - case .Clubs: return "♧" + case .spades: return "♤" + case .hearts: return "♡" + case .diamonds: return "♢" + case .clubs: return "♧" } } } // Los valores de enum permite la sintaxis corta, sin necesidad de poner // el tipo del enum cuando la variable es declarada de manera explícita -var suitValue: Suit = .Hearts +var suitValue: Suit = .hearts // Enums de tipo no-entero requiere asignaciones de valores crudas directas enum BookName: String { -- cgit v1.2.3 From 9a9e52b54bf9bc6ebeefc996452f5944a234557f Mon Sep 17 00:00:00 2001 From: Damian Rzeszot Date: Mon, 9 Oct 2017 12:02:29 +0200 Subject: swift | fix style guidelines --- es-es/swift-es.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'es-es') diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown index ea892628..cd16d318 100644 --- a/es-es/swift-es.html.markdown +++ b/es-es/swift-es.html.markdown @@ -463,10 +463,10 @@ var suitValue: Suit = .hearts // Enums de tipo no-entero requiere asignaciones de valores crudas directas enum BookName: String { - case John = "John" - case Luke = "Luke" + case john = "John" + case luke = "Luke" } -print("Name: \(BookName.John.rawValue)") +print("Name: \(BookName.john.rawValue)") // Enum con valores asociados enum Furniture { -- cgit v1.2.3 From e8ee66c854b8833fcb0fd76b5e9ace6ae8379397 Mon Sep 17 00:00:00 2001 From: Damian Rzeszot Date: Mon, 9 Oct 2017 12:03:27 +0200 Subject: swift | fix style guidelines --- es-es/swift-es.html.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'es-es') diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown index cd16d318..22e3c532 100644 --- a/es-es/swift-es.html.markdown +++ b/es-es/swift-es.html.markdown @@ -471,23 +471,23 @@ print("Name: \(BookName.john.rawValue)") // Enum con valores asociados enum Furniture { // Asociación con Int - case Desk(height: Int) + case desk(height: Int) // Asociación con String e Int - case Chair(String, Int) + case chair(String, Int) func description() -> String { switch self { - case .Desk(let height): + case .desk(let height): return "Desk with \(height) cm" - case .Chair(let brand, let height): + case .chair(let brand, let height): return "Chair of \(brand) with \(height) cm" } } } -var desk: Furniture = .Desk(height: 80) +var desk: Furniture = .desk(height: 80) print(desk.description()) // "Desk with 80 cm" -var chair = Furniture.Chair("Foo", 40) +var chair = Furniture.chair("Foo", 40) print(chair.description()) // "Chair of Foo with 40 cm" -- cgit v1.2.3