Last active
October 11, 2015 04:48
-
-
Save HiroNakamura/3805664 to your computer and use it in GitHub Desktop.
Iniciando con Ceylon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ************************** | |
| C E Y L O N | |
| ************************** | |
| 1. Crear directorio | |
| samples>mkdir directorio\source | |
| 2. Crear programa.ceylon | |
| samples>more > directorio>source\miProg.ceylon | |
| /** | |
| *@version 0.0.1 | |
| *@author yo | |
| */ | |
| void run(){ | |
| for(n in 1..12){ | |
| print("" n ""); | |
| } | |
| } | |
| [Esto ya no va] | |
| 3. Compilar | |
| samples\directorio>..\..\bin\ceylonc default | |
| 4. Ejecutar | |
| samples\directorio>..\..\bin\ceylon default | |
| [Versión ceylon version 0.4 (Analytical Engine) ] | |
| Compilar: | |
| ceylon compile source\programa.ceylon | |
| Ejecutar: | |
| ceylon run default | |
| http://www.javamexico.org/categorias/lenguajes_jvm/ceylon | |
Author
Author
doc "Iniciando..."
by "yo"
//compile: ceylon compile source\eje10.ceylon
//run: ceylon run default
void run(){
hola();
holaParametro("is a String");
}
void hola(){
print("Ceylon... funcionando correctamente :) !!");
}
void holaParametro(String param){
print ("Hola " param "");
}
Author
[ceylon version 0.4 (Analytical Engine)]
compilar:
ceylon compile source\programa.ceylon
ejecutar:
ceylon run default
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//Otro ejemplo de Ceylon
doc "tarde pero ya pude realizar este ejercicio"
void run(){
Integer valor=2000000;
variable Integer suma:=0;
Boolean esPrimo(Integer numero){
variable Integer aux:=0;
variable Integer cont:=2;
while(cont<numero){
aux:=numero%cont;
if(aux==0){
return true;
}
cont++;
}
}
for(Integer n in 1..valor){
if(esPrimo(n)){
//print("" n " es primo");
suma:=suma+n;
}
}
print("suma obtenida: " suma "");
}