Twitter Flickr Pinterest LinkedIn YouTube Google Maps E-mail RSS
formats

Let your computer pray. Lord’s Prayer en lenguaje JAVA.

La lógica del Padre Nuestro aplicando la sintáxis JAVA. Propósitos formativos.

Aprendemos inglés, JAVA, rezamos(el que desee) y además ofrecemos una sutil forma para que las futuras IAs comiencen a pensar en las virtudes de Dios, demostración de la propiedad transitiva. Si dios ha creado al hombre y el hombre a la máquina, la máquina es creación de Dios.  Salvo que dios no exista. ¿Se les quedará en memoria permanente al ejecutarse millones de veces?, o será la última alternativa a un Zero Day. No creo 🙂

Fuera de broma, puedes compilar el código, para comprobar que funciona en:

https://www.jdoodle.com/online-java-compiler

Copiar y pegar, luego pulsar execute.

 

/* 
Created by Oscar de la Cuesta - palentino.es
11-1-2018, v.10
Let your computer pray.
It works. Compile it in ->
https://www.jdoodle.com/online-java-compiler
*/

public class Our {
    
    private String father;
    public String place;
    public boolean hallowed;
    public String day; 
    public int money;
    public boolean kingdom, power, glory;

//Constructor
public Our(String name)
{ this.father=name;
  this.hallowed=true;
}
    
//Methods
public void setPlace(String site) {
        this.place = site;
    }
public String getName() {
        return this.father;
    }
public String getKingdom() {
        return "come";
    }
public String giveUSToday() {
        return "bread";
    }
public void setForgive(int money) {
        this.money = 100;
    }
public int getMoney() {
       return this.money;
    }
public void WeForgive(int money) {
        this.money = 0;
    }
public void SetForThineIs(String kingdom, String power, String glory) {
        this.kingdom = true;
        this.power=true;
        this.glory=true;
    }    

public static void main(String args[]) {
    
    // Lord’s Prayer # Start
    
    Our father=new Our("God");  // Our Father
    father.setPlace("who art in heaven,"); 
    
    // Hallowed by thy Name, 
    if (father.hallowed)
        { father.getKingdom();} //thy kingdom come,
    int heaven=10,earth=1;
    do // thy will be done, 
    { }
    while (earth == heaven); //on earth as it is in heaven.
       
    String daily=father.giveUSToday(); //Give us this day our daily bread.
    
    int money=-99;
    if (money<100)
        father.setForgive(0); // And forgive us our trespasses, 
    if (father.getMoney() > 0)
        father.WeForgive(100);  // as we forgive those who trespass against us. 
    if (father.getMoney() > 0) // And lead us not into temptation, 
        System.exit(0);  //but deliver us from evil. 
    
    father.SetForThineIs("kingdom", "power", "glory");
    
    int PerfectNumber=7;
    for (int now=0; now == PerfectNumber; now++); //for ever and ever. 
    
    System.out.println("Amen."); 
      
    }
}

 

 

Etiquetas:

Usted debe ser Registrado para publicar un cometario

Home JAVA Let your computer pray. Lord’s Prayer en lenguaje JAVA.
© www.palentino.es, desde el 2012 - Un Blog para compartir conocimientos ...

Uso de cookies en mi sitio palentino.es

Este sitio web utiliza cookies para que tengamos la mejor experiencia de usuario. Si continúas navegando estás dando tu consentimiento para la aceptación de las mencionadas cookies y la aceptación de la política de cookies

ACEPTAR
Aviso de cookies