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
#include "miniwin.h" | |
using namespace miniwin; | |
const int ANCHO = 600; | |
const int ALTO = 600; | |
void barra(int x, int y, int ancho, int largo){ | |
color(VERDE); | |
for(int i=x; i<x+largo; i+=10){ | |
espera(50); | |
rectangulo_lleno(i,y-ancho/2,i+10,y+ancho/2); | |
refresca(); |
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
#include "miniwin.h" | |
#include "cmath" | |
using namespace miniwin; | |
void Cabecera(const char* titulo){ | |
color(AZUL); | |
rectangulo(10,10,690,50); | |
color(VERDE); | |
texto(15,15,titulo); |
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
// Import the functions you need from the SDKs you need | |
import { initializeApp } from "firebase/app"; | |
import { getAuth } from "firebase/auth"; | |
import { getFirestore } from "firebase/firestore"; | |
// TODO: Add SDKs for Firebase products that you want to use | |
// https://firebase.google.com/docs/web/setup#available-libraries | |
// Your web app's Firebase configuration | |
const firebaseConfig = { | |
apiKey: "", |
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
import {configureStore} from "@reduxjs/toolkit"; | |
export const store = configureStore({ | |
reducer: { | |
counter: CounterSlice.reducer, | |
}, | |
// middleware: (getDefaultMiddleware) => getDefaultMiddleware({ | |
// serializableCheck: false | |
// }) |
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
% Definición de los meses del año | |
esMes(1, enero). | |
esMes(2, febrero). | |
esMes(3, marzo). | |
esMes(4, abril). | |
esMes(5, mayo). | |
esMes(6, junio). | |
esMes(7, julio). | |
esMes(8, agosto). | |
esMes(9, septiembre). |
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
-- Lista por comprensión que genera los números del 5 al 10 y los eleva al cubo | |
cubosDel5Al10 :: [Int] | |
cubosDel5Al10 = [x^3 | x <- [5..10]] | |
-- Lista por comprensión que genera los primeros 6 números naturales, los multiplica por dos y luego les resta uno | |
procesados :: [Int] | |
procesados = [2 * x - 1 | x <- [1..6]] | |
main :: IO () | |
main = print procesados |
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
;Crear un programa empleando LISP que reciba una lista de valores numéricos y | |
;devuelva otra lista solo con los valores múltiplos de 3 y estos elevados al cubo. | |
(defun multiplotres (lista) | |
(mapcan | |
(lambda (x) | |
(if (= (mod x 3) 0) | |
(list (* x x x)) | |
nil) | |
) |
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
(defpackage "EJERCICIOS") | |
;;1.1 Definir una función que calcule el valor de: | |
;; F = 1/ sqrt (ax2 + bx2 + c) | |
(defun f.1.1 (a b c) | |
(lambda (x) (let ((x2 (expt x 2))) | |
(/ 1 (sqrt | |
(+ (* a x2) | |
(* b x2) |
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
factorial(0,1). | |
factorial(N,R):- N>0,N1 is N-1 , factorial(N1,R1), R is N*R1. | |
fibonacci(0,1). | |
fibonacci(2,1). | |
fibonacci(N,R):- N>2,N1 is N-1, N2 is N-2,fibonacci(N1,R1),fibonacci(N2,R2), R is R1+R2. |
NewerOlder