This file contains hidden or 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
[ | |
{ | |
"pregunta": "Quin planeta és conegut com el planeta vermell?", | |
"opcions": ["Mart", "Venus", "Júpiter", "Saturn"], | |
"correcta": "Mart" | |
}, | |
{ | |
"pregunta": "Quant és 9 x 7?", | |
"opcions": ["56", "63", "72", "69"], | |
"correcta": "63" |
This file contains hidden or 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
# Trivial v1.0 (Versió Ruby) | |
require "json" | |
ARXIU_PREGUNTES = "preguntes.json" | |
def carregar_preguntes | |
if File.exist?(ARXIU_PREGUNTES) | |
JSON.parse(File.read(ARXIU_PREGUNTES, encoding: "utf-8")) | |
else |
This file contains hidden or 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
# Trivial v1.0 -> Començat el 15/10/2025 | |
import json | |
import random | |
ARXIU_PREGUNTES = "preguntes.json" | |
def carregar_preguntes(): | |
try: | |
with open(ARXIU_PREGUNTES, "r", encoding="utf-8") as f: |
This file contains hidden or 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
# Gestor de tasques Ruby | |
tasques = [] | |
completades = [] | |
def mostrar_menu | |
puts "----- MENÚ -----" | |
puts "1. Afegir tasca" | |
puts "2. Mostrar tasques pendents" | |
puts "3. Mostrar tasques completades" |
This file contains hidden or 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
# Puntuador de contrasenyes | |
import re | |
from palabras import palabras_ | |
puntuacion = 0 | |
# Puntuación de contraseñas: | |
# Longitud >= 8 +2 fet | |
# Longitud >= 12 +2 fet | |
# Tiene mayúsculas +1 fet | |
# Tiene minúsculas +1 fet |
This file contains hidden or 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
# Gestor d'arxius Duplicats v1.0 -> Començat a les 12:00PM de Dimarts 23/07/2025 | |
# Primera sessió: 12:00PM -> 12:50PM, 23/07/25 (50 Minuts) | |
# Segona sessió 13:30 -> 14:45, 23/07/25 (75 Minuts) | |
# FINALITZAT en 125 minuts | |
# Primera Revisió: 14:45 -> 14:55, 23/07/25 (10 Minuts) | |
# PROPOSTES: MILLORES D'OPTIMITZACIÓ | |
# Cal un métode de comparació millor, molt lent en aquest cas | |
# No es fa servir hash: | |
# O el faig servir a la comparació o no el calculo | |
# Al calcular hash, agafa tot el codi: |