-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
porque debemos hacer merge
- Loading branch information
Showing
15 changed files
with
542 additions
and
102 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
service_name: travis-ci |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: ruby | ||
|
||
rvm: | ||
|
||
- 1.9.3 | ||
- 1.9.2 | ||
- 2.1.1 | ||
- jruby-18mode # JRuby in 1.8 mode | ||
|
||
- jruby-19mode # JRuby in 1.9 mode | ||
|
||
- rbx-18mode | ||
|
||
- rbx-19mode | ||
|
||
- 1.8.7 | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
Practica 6 LPP | ||
[![Build Status](https://travis-ci.org/alu0100505092/prct08.svg?branch=des)](https://travis-ci.org/alu0100505092/prct08) | ||
[![Coverage Status](https://img.shields.io/coveralls/alu0100505092/prct08.svg)](https://coveralls.io/r/alu0100505092/prct08) | ||
[![Coverage Status](https://coveralls.io/repos/alu0100505092/prct08/badge.png)](https://coveralls.io/r/alu0100505092/prct08) | ||
https://travis-ci.org/alu0100505092/prct08.svg?branch=des | ||
https://travis-ci.org/alu0100505092/prct08.svg?branch=master | ||
|
||
Practica 9 LPP | ||
|
||
Integrantes LPP_T_13 | ||
Angelica Ravelo | ||
Joaquin Escobar | ||
|
||
|
||
Practica sobre Listas Enlazadas en RUBY( Linked List) | ||
Practica sobre Clase Examen, y creacion clase Interfaz, en la clase Interfaz se comprueban las respuestas ingresadas por el usuario | ||
, con sus expectativas. | ||
|
||
|
||
Expectativas | ||
|
||
Examen | ||
Nodo | ||
-Debe existir un Nodo de la lista con sus datos y su siguiente | ||
|
||
Lista | ||
-Se extrae el primer elemento de la lista | ||
-Se puede insertar un elemento | ||
-Se pueden insertar varios elementos | ||
-Debe existir una Lista con su cabeza |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Examen | ||
class EleccionSimple < Pregunta | ||
|
||
def initialize arg | ||
#attr_reader :enuncia2, :verdadero, :falso | ||
#super(enunciado,verdadero,falso) | ||
super(arg) | ||
end | ||
|
||
|
||
end | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
require "examen/lista" | ||
module Examen | ||
class Exam | ||
attr_reader :preguntas, :respuescorrectas | ||
def initialize (args) | ||
@preguntas = args[:preguntas] | ||
@respuescorrectas=args[:respuescorrectas] | ||
end | ||
|
||
def insertQuestion(question) | ||
nodo=Nodo.new(question) | ||
nodoInsertado = @preguntas.pushf(nodo) | ||
nodoInsertado.value | ||
end | ||
|
||
def insertQuestion2(question) | ||
nodo=Nodo.new(question) | ||
nodoInsertado = @preguntas.push(nodo) | ||
nodoInsertado.value | ||
end | ||
|
||
|
||
def compresp(resp) | ||
correctas=0 | ||
i=0 | ||
n=0 | ||
|
||
while n < 5 do | ||
if @respuescorrectas[i] == resp[i] | ||
correctas+=1 | ||
end | ||
i+=1 | ||
n+=1 | ||
end | ||
if correctas < (i/2)+1 | ||
mensaje = "Ha suspendido el examen: #{correctas}/#{i}" | ||
else | ||
if correctas == i | ||
mensaje = "Su nota es: Sobresaliente 10" | ||
else | ||
mensaje = "Ha aprobado el examen: #{correctas}/#{i}" | ||
end | ||
end | ||
mensaje | ||
end | ||
|
||
|
||
def preguntas | ||
@preguntas | ||
end | ||
|
||
|
||
def respu | ||
@respuescorrectas | ||
end | ||
|
||
|
||
end | ||
end | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Examen | ||
|
||
class Examen < Lista | ||
|
||
def initialize | ||
|
||
super(nodo) | ||
|
||
end | ||
|
||
|
||
|
||
|
||
|
||
end | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
require 'examen/exam' | ||
require 'examen/lista' | ||
module Examen | ||
|
||
class Interfaz | ||
|
||
attr_reader :examen | ||
def initialize(args) | ||
@examen=args[:examen] | ||
|
||
|
||
end | ||
|
||
def to_s | ||
aux = @examen.inicio | ||
respuesta = "" | ||
respuesta += aux.value.to_s | ||
respuesta += "\n" | ||
while (aux != @examen.fin) do | ||
aux = aux.next | ||
respuesta += aux.value.to_s | ||
respuesta += "\n" | ||
end | ||
respuesta | ||
end | ||
|
||
def invertir | ||
aux = @examen.fin | ||
respuesta = "" | ||
respuesta += aux.value.to_s | ||
respuesta += "\n" | ||
while (aux != @examen.inicio) do | ||
aux = aux.prev | ||
respuesta += aux.value.to_s | ||
respuesta += "\n" | ||
end | ||
respuesta | ||
end | ||
|
||
|
||
|
||
def invertirfuncional(arr) | ||
#aux=%W(#{arr}) | ||
#lambda {|a| a.map(&:reverse) }.call(aux.reverse) | ||
arr2=Array.new | ||
arr.reverse_each do |z| | ||
arr2.push(z) | ||
end | ||
arr2 | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.