Matías Blanco – Sergio Pérez. The Problem A few peregrins, each one with his own strenght and money want to make the Saint James’ Way. They can start.

Slides:



Advertisements
Presentaciones similares
Verb Conjugations ¡Muy fácil! Vamos a repasar. I go to the store. Johnny goes to the store. We sing very well. Stacey sings very well. Thats verb conjugation.
Advertisements

ANTE TODO In Unidad 9, you learned that the subjunctive is used in adverbial clauses after certain conjunctions. You will now learn how the subjunctive.
Verb Conjugations Easier than you think.
saquen la tarea en la página 57, ejercicio 1 ejemplos 4 y 5
La gramática.  Use the subjunctive in adjective clauses to express that the existence of someone or something is uncertain or indefinite.  Ejemplo:
Programación orientada a objetos
Los verbos regulares – ar What is an infinitive? An infinitive in both Spanish and English is the base form of the verb. In English, the infinitive.
Stem-changing verbs.
 Stem is the very first part of the verb, the underlined part: › Hablar › Comer › Escribir.
VOCABULARIO #2.4 ¡Aprenda! Forming Questions Señora Sequin.
Stem Changing Verbs Shoe Verbs Boot Verbs.
Telling Time.
1 – 999,999,999.
Period 2 Guillermo, Estrella, Orlando, Francisca.
Conjugating AR verbs What is an –AR verb?. First, let’s talk about verbs… What is an infinitive? The basic form of a verb Means “to do something” Has.
©2014 by Vista Higher Learning, Inc. All rights reserved Spanish has two verbs that mean to know: saber and conocer. They cannot be used interchangeably.
SPANISH STEM-CHANGING VERBS e→ie o→ue u→ue e → i.
Notes #18 Numbers 31 and higher Standard 1.2
-AR Verbs In Spanish, there are three classes (or conjugations) of verbs: those that end in –AR, those that end in –ER, and those that end in –IR. This.
How to Conjugate Regular –AR Verbs in the Present Tense.
How to Conjugate Regular –AR – Er - IR Verbs in the Present Tense.
Español 1. Types of questions Generally speaking, there are three types of questions  Tag  Sí / No  Information seeking.
What has to be done today? It can be done in any order. Make a new ALC form Do the ALC Get two popsicle sticks Get 16 feet of yarn. That is 4 arms width.
--AR verb conjugations in the Present tense.   Remember!  While watching the tutorial, take notes in your Spanish notebook.  You can pause, stop and.
DIRECT OBJECT PRONOUNS. DIRECT OBJECTS The object that directly receives the action of the verb is called the direct object. Mary kicked the ball. "Ball"
Los Verbos  Today we will be learning about Spanish verbs.  Start a new section in your notes labeled Los Verbos.  Begin by answering these questions:
First Grade – High Frequency Word Reading Competition Classroom Competition Created by: Malene Golding School Improvement Officer: Kimberly Fonteno.
Definite & indefinite articles
English Lesson 3.
ALC 155 miércoles el 25 de mayo. Bienvenida Sientense SS – lado a lado Uno lee las preguntas en voz alta la otra persona contesta.
Entrada: Describe a una persona importante [en el libro importante] Escoge (choose) a un miembro de tu familia o un amigo. Entonces, piensa en su personalidad.
¿Qué haces en la escuela? Question words, objects, yo-go’s.
Señorita Rojo Señor Amarillo Padre Verde Señora Azul La pistola La soga El cuchillo El dormitorio El cuarto de baño La cocinaEl salón Señorita Rojo Señor.
Las Preguntas (the questions) Tengo una pregunta… Sí, Juan habla mucho con el profesor en clase. No, Juan no habla mucho en clase. s vo s vo Forming.
Quasimodo:  Get markerboards!  TRADUCIR:  I don’t give money (dinero) to you. No te doy dinero.  They want to buy tickets for her. Ellos quieren comprarle.
Time Telling time is rather easy. You only need to know the numbers up to 59 to be able to tell the time.
Digital Photography: Selfie Slides Anaiyah holiday 10/23/2014 6th.
ALC 63: Traducir Hoy es miércoles el 25 de marzo, 2015 I text on the phone every day. What do you do everyday? I play video games in my living room. Where.
Spanish Sentence Structure How can we make better sentences?
The Future Tense -original PowerPoint created by Mrs. Shirley of North Intermediate High School in Broken Arrow, OK.
Día 72 Final Review 4 – Conjugation Review. Calentamiento Make sure you picked up the piece of paper by the door. Begin working on the “calentamiento”
El futuro What is the future tense? When would you use it?
BARTERING. What is Bartering? Bartering is negotiating a lower price between a buyer and a seller of a good or service Bartering is negotiating a lower.
CONJUGATION.
Hoy es jueves, el cinco de septiembre
Associative, Commutative, and Distributive Properties of Addition and Multiplication August 18th Students only need to copy the writing in purple. Students.
JUEVES, EL 10 DE SEPTIEMBRE LT: I WILL RECOGNIZE SOME NEW VOCABULARY WORDS. Go over tests & retake procedures Interpretive Assessment: numbers & alphabet.
unas frases increíblemente útiles some incredibly useful phrases (for dodging conjugation)
ALC 68 Hoy es martes el 27 de marzo de 2012 Hay 12 preguntas para la bienvenida. If you have not done the bienvenida yet, you need to make a new flash.
Essential ?: How do I use these irregular verbs? How are they different than the verbs I already know?
Conjugating Verbs! *You already know several verbs *Remember any???? *andar, hablar, estudiar, caminar, escuchar, etc…
Survival Spanish for travelers Lesson 4: Verbs, verbs everywhere! Part 1.
Si Clauses (Cláusulas de si) Si lo comemos todo, ganamos el concurso.
Double Object Pronouns What happens when we have both direct and indirect object pronouns in the same sentence? What goes where? Information for this lesson.
LOS VERBOS!!!. We already know these phrases in Spanish:
Quasimodo:  If you picture isn’t 100% done quickly finish it now while we wait for class to start  Get ready for your vocab quiz!
LOS VERBOS REFLEXIVOS. WRITE: What is a reflexive verb? A reflexive verb describes when a person doing an action is also receiving the action.
English Language II (2). English Language I (2) Warm-up.
FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD FAMILY FEUD.
¿Qué película has visto? Español 2 Ch 6B. Cápitulo 6B Vocabulario.
Los verbos reflexivos Objective: To be able to talk about your daily routine. Getting ready for a special event.
1 There are three basic ways to ask questions in Spanish. Can you guess what they are by looking at the photos and photo captions on this page?
AQA Unit 2 Speaking Los medios La televisión La publicidad Las tecnologías de la comunicación La cultura de todos los días El cine La música La moda La.
Spanish Stem-Changing Verbs
Getting to know you more!
First Grade Dual High Frequency Words
Spanish Stem-Changing Verbs
Quasimodo: Tienes que hacer parte D de la tarea..
Hoy vamos a..... escuchar y entender un rap en español
My life Name: benjamín Aravena barrios Thicher: Alexis fernandes DATE: 26|06|2018 COURSE: 7°BASICO.
Transcripción de la presentación:

Matías Blanco – Sergio Pérez

The Problem A few peregrins, each one with his own strenght and money want to make the Saint James’ Way. They can start their journey from three different places: Roncesvalles, Somport or Nájera… but the way is long and they will need to rest in order to recover their energy. When a peregrin arrives to a city the first thing he does is trying to sleep at a free hostel. In this case he spents no money at all. If the hostel is at its full capacity he’ll try to pay for a room at a Hotel. He’ll be always resting better at a hotel than at a free hostel. He’ll recover more energy but at a cost. If a peregrin can’t pay, he’ll not rest at all. If he has not enought energy to move to the next city, he’ll quit his journey.

Our solution  We’ve used protected types – A city is a protected type, and the whole way is formed by them. So the way could be know as an array of protected types.  A city will have these properties:  The next city (integer representing the position of the city in the array)  The cost for moving to the next city (in terms of energy)  The numbersof rooms the local hostel has.  The energy recovered if sleeping at a free hoStel  The energy recovered if sleeping at a Hotel  The price of a room at the hotel

Ciudad protected type Ciudad is procedure Init(next_cost : Integer;next_c: Integer; plazasA : Integer; F_Recupera_Alb : Integer; HotelCuesta :Integer; F_Recupera_Hot : Integer); procedure DormirEnAlbergue (Id : Integer; PuedeDormir : out Boolean; Fuerza : in out Integer); procedure SalirDeAlbergue (Id : Integer); procedure DormirEnHotel (Id : Integer; Dinero : in out Integer; PuedeDormir : out Boolean; Fuerza : in out Integer); procedure SalirDeHotel(Id : Integer); function get_next_ciu return Integer; function get_next_ciu_cuesta return Integer; private next_ciu_cuesta : Integer; next_ciu : Integer; PlazasAlbergue : Integer; F_Recupera_Alblbergue : Integer; Precio_hotel : Integer; F_Recupera_Hotel: Integer; end Ciudad;

Ciudad (2) procedure DormirEnAlbergue (Id : Integer; PuedeDormir : out Boolean; Fuerza : in out Integer) is begin PuedeDormir := False; -- En un principio no if PlazasAlbergue > 0 then Put_Line("El peregrino "&Integer'Image(Id)&" consigue sitio en albergue"); Put_Line("+ "&Integer'Image(F_Recupera_Alblbergue)&" fuerza"); Put_Line(Integer'Image(PlazasAlbergue)&" plazas"); plazasAlbergue := PlazasAlbergue - 1; Fuerza := Fuerza + F_Recupera_Alblbergue; PuedeDormir := True; -- Entonces sà end if; end DormirEnAlbergue;

Ciudad (4) procedure SalirDeHotel (Id : Integer) is begin Put_Line("El peregrino "&Integer'Image(Id)&" se va del hotel"); end SalirDeHotel; function get_next_ciu return Integer is begin return next_ciu; end get_next_ciu; function get_next_ciu_cuesta return Integer is begin return next_ciu_cuesta; end get_next_ciu_cuesta;

Camino type Camino is array (1.. MAX_CIUDADES) of Ciudad; CaminoDeSantiago : Camino;

Peregrino task body Peregrino is Dinero : Integer; Fuerzas : Integer; Fracaso : Boolean; Tiempo_Dormir : constant := 3.0; CiudadActual : Integer; PuedeDormir : Boolean; Descansa_En : TDescanso; begin Fuerzas := Integer(Random(G)*Float(MAX_FUERZAS-2))+2; Dinero := Integer(Random(G)*Float(MAX_DINERO-1))+1; CiudadActual := Integer(Random(G)*2.0)+1; -- 1, 2 o 3 Fracaso := False; -- Inicializado a false

Peregrino (2) while CiudadActual /= SANTI and not Fracaso loop Descansa_En := nada; -- Por defecto CaminoDeSantiago(CiudadActual).DormirEnAlbergue(Id, PuedeDormir, Fuerzas); if not PuedeDormir then Put_Line("El peregrino "&Integer'Image(Id)&" no encuentra sitio en el albergue"); CaminoDeSantiago(CiudadActual).DormirEnHotel(Id, Dinero, PuedeDormir, Fuerzas); if not PuedeDormir then Put_Line("El peregrino "&Integer'Image(Id)&" no puede permitirse el hotel"); else Descansa_En := hotel; end if; else Descansa_En := albergue; end if;...

Peregrino (3) if PuedeDormir then delay Duration(Tiempo_Dormir*Random(G)); if Descansa_En = albergue then CaminoDeSantiago(CiudadActual).SalirDeAlbergue(Id); elsif Descansa_En = hotel then CaminoDeSantiago(CiudadActual).SalirDeHotel(Id); end if; -- Se va si ha descansado else Put_Line("El peregrino "&Integer'Image(Id)&" no descansa en "&Integer'Image(CiudadActual)); end if;

Peregrino (4) if Fuerzas < CaminoDeSantiago(CiudadActual).get_next_ciu_cuesta then Put_Line(“¡¡POBRE!! El peregrino "&Integer'Image(Id)&" fracaso, no tiene fuerzas!!"); Fracaso := True; -- Jarl else -- Si puede... if CiudadActual /= SANTI then Put_Line("El peregrino "&Integer'Image(Id)&" a por la ciudad "&Integer'Image(CaminoDeSantiago(CiudadActual).get_next_ciu)); Fuerzas := Fuerzas - CaminoDeSantiago(CiudadActual).get_next_ciu_cuesta; Ciudadactual := CaminoDeSantiago(CiudadActual).get_next_ciu; end if; end loop; -- sale de aquí = ya no va a ningín sitio más

Peregrino (5) … continúa desde “fin loop” de recorrer nodos if not Fracaso then Put_Line("BIENNNNN!!! Peregrino"&Integer'Image(Id)&" ha llegado a Santiago de Compostela!! Rece por nosotros! Para aprobar!!"); end if; end Peregrino;

Initialization procedure InitNodos is begin -- Informacion del camino, ayuda x J. Peris (gracias) CaminoDeSantiago(1).Init(3,3,2,1,3,2); -- Roncesvalles CaminoDeSantiago(2).Init(4,4,2,1,3,1); -- Somport CaminoDeSantiago(3).Init(2,2,1,1,3,1); -- Nájera CaminoDeSantiago(4).Init(5,6,1,2,3,2); -- Otro CaminoDeSantiago(5).Init(6,4,1,2,3,2); -- … CaminoDeSantiago(9).Init(0,0,1000,1000,1000,1000); end InitNodos;

Initialization (2) begin InitNodos; for I in 1..MAX_PEREGRIN loop Peregrinos := new Peregrino(I); delay Duration(Random(G)); end loop; end CaminoTProtAda;

Screenshot

Questions? Thank you.