Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions agustinTareas/cambioIdiomas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function saludar(idioma){
let bienvenida = {
ingles:"welcome",
checo: "Vitejte",
danes: "Velkomst",
estoniano: "Tere tulemast",
frances: "Bienvenue",
aleman: "Willkommen",
irlandes: "Failte",
italiano: "Benvenuto",
lituano: "Laukiamas",
polaco: "Witamy",
español: "Bienvenido",
sueco: "Valkommen",
croata: "Croeso"
}
return bienvenida.hasOwnProperty(idioma) ? bienvenida[idioma]: bienvenida.ingles;

}
16 changes: 16 additions & 0 deletions agustinTareas/cercaDelCero.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let array = [];
function cercano(array,numeros){
let a = 0;
let diferenciaMinima = 1000;
let ans;
for (a in array){
let m = Math.abs(numeros-array[a]);
if(m < diferenciaMinima){
diferenciaMinima = m;
ans = array[a];
}
return ans;
}

}
console.log(cercano(array,88));
17 changes: 17 additions & 0 deletions agustinTareas/claseBola.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let Ball = function(ballType){
this.ballType = ballType || 'regular';

};
let sBall = function(ballType){
this.ballType = ballType || 'super';

};
if(Ball == true){
console.log('regular')
}
else if ( sBall == false){
console.log('super')
}
else {
console.log('indefinido')
}
10 changes: 10 additions & 0 deletions agustinTareas/cubo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function cubo (a,b){
let as = a.reduce((x,y) => x*y);
let bs = b.reduce((x,y) => x*y);
return as > bs ? as-bs: bs-as;
}

let a = [50,15,25];
let b = [19,24,14];

console.log(cubo(a,b))
18 changes: 18 additions & 0 deletions agustinTareas/descBoletos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function pelicula (tarjeta, ticket, descuento){
let n = 1;
let precio_ticket;
let temp = ticket;
let total = 0;
while(true){
precio_ticket = ticket *n;
temp *= descuento;
total += temp;
if(precio_ticket > Math.ceil(total+tarjeta)){
break;
}
n++;
}
return n;

}
console.log (pelicula(12, 4, .90));
37 changes: 37 additions & 0 deletions agustinTareas/ordBurbuja.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
let array = crearArreglo(10);
let vueltas = 1;

console.log('desordenado', array);

ordBurbuja();

console.log('ordenado', array);

function crearArreglo (tamaño) {
let arr = [];

for(let i = tamaño; i > 0; i--){
arr.push(i);
}
return arr;
}


function cambiar (indexA, indexB){
const temp = array[indexA];
array [indexA] = array [indexB];
array [indexB] = temp;

console.log(vueltas++, '-', indexA , indexB, 'Intercambio===', temp, array[indexA]);
}

function ordBurbuja(){
for(let i = 0; i < array.length; i++) {
for(let j = 0; j <array.length - 1; j++) {
if (array[j] > array[j + 1]){
cambiar(j, j + 1 )
}

}
}
}
10 changes: 10 additions & 0 deletions agustinTareas/parametrosUrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function getUrlParams(busqueda){
let llave = busqueda.slice(busqueda.indexOf('?')+ 1).split('&');
let parametros = {}
llave.map(hash =>{
let [key,val] = hash.split('=')
parametros[key]= decodeURIComponent(val)
})
return parametros;
}
console.log(getUrlParams(window.location.busqueda))
23 changes: 23 additions & 0 deletions agustinTareas/patoganso.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

let array = duck_duck_goose([a, b, c, d], 1)
let arreglo = duck_duck_goose([a, b, c, d], 4)
function patoPatoGanso(jugador, ganso){
return jugador[(ganso-1)% jugador.length].name;

for (x=0; x <4 ; x++) {

for (y=0; y < arr_name ; y++) { //for para la cantidad de jugadores

if (x == 1) {//este va a decir quien es pato y quien es ganso
console.log(array.ganso)

break; //para dejar de elegir al ganso
}
if (y == 4) { //este if va a decir si atrapo o no
console.log(arreglo.pato)

}
}
}
}
console.log(patoPatoGanso)
18 changes: 18 additions & 0 deletions agustinTareas/prototipo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*name user argument or 'Hero'
position '00'
health 100
damage 5
experience 0*/

function hero (nombre){
this.nombre = nombre || 'hero';
this,posicion = '00';
this.vida = 100;
this.daño = 5;
this.exp = 0;
}
console.log(hero);




45 changes: 45 additions & 0 deletions agustinTareas/rotacion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
let laPalabra = 'parangaricutirimicuaro'
let laCadena = [ 'que', 'paso', 'aqui', 'halo']



function rotaciones(palab) {

let rot = []
for (let i = 0; i < palab.length; i++) {


let p1 = palab.substring(i)
let p2 = palab.substring(0, i)




rot.push(p1 + p2)

}


return rot


}

function contain_all_rots(palabra, cadena) {
let miRot = rotaciones(palabra)
console.log(miRot)
for (let j = 0; j < miRot.length; j++) {
// console.log(!cadena.includes(mirotacion[j]))
if (!cadena.includes(miRot[j])) {
console.log(miRot[j])
return false
}

}
return true



}

console.log(contain_all_rots(laPalabra, laCadena))
15 changes: 15 additions & 0 deletions agustinTareas/tapiz.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function tapiz(largo, ancho, alto) {
let rollo = (10 * .52);
let newAlto = (alto * .15) + alto; //error previsto del 15%
let areaPorCubrir = 2 *((largo*newAlto) + (ancho*newAlto));
let r = Math.ceil(areaPorCubrir/rollo); //resultado de la operacion de area acubrir entre el tamaño del rollo
let numero = ["uno", "dos", "tres", "cuatro", "cinco", "seis", "siete", "ocho", "nueve", "diez", "once", "doce", "trece", "catorce", "quince", "diesciseis", "diescisiete", "diesiocho", "diescinueve", "veinte"]
if (r > 0 && r < 21) { // se asegura que no pase del 20
return numero[r-1];// la posicion r no coincide con el contenido de dicha posicion en el arrglo, entonces r-1
} else if (r === 0) {// si r es igual a 0 no se comprara rollos
return "cero";
} else { // devuelve el valor de r en numero y no en string para los casos que son mayor a 20 rollos
return r;
}
}
console.log (tapiz(1, 2, 6))
13 changes: 13 additions & 0 deletions agustinUsabilidad/clonVue/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
39 changes: 39 additions & 0 deletions agustinUsabilidad/clonVue/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
27 changes: 27 additions & 0 deletions agustinUsabilidad/clonVue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ClonVue

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Loading