diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index b847dc58..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/php/.devcontainer/base.Dockerfile -# [Choice] PHP version (use -bullseye variants on local arm64/Apple Silicon): 8, 8.0, 7, 7.4, 7.3, 8-bullseye, 8.0-bullseye, 7-bullseye, 7.4-bullseye, 7.3-bullseye, 8-buster, 8.0-buster, 7-buster, 7.4-buster, 7.3-buster -ARG VARIANT=7-bullseye -FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT} - -# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 -ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 9d91f9db..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,49 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/php -{ - "name": "PHP", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update VARIANT to pick a PHP version: 8, 8.0, 7, 7.4, 7.3 - // Append -bullseye or -buster to pin to an OS version. - // Use -bullseye variants on local on arm64/Apple Silicon. - "VARIANT": "7-bullseye", - "NODE_VERSION": "lts/*" - } - }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "php.validate.executablePath": "/usr/local/bin/php" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "felixfbecker.php-debug", - "bmewburn.vscode-intelephense-client", - "mrmlnc.vscode-apache" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [8080], - - // Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. - "portsAttributes": { - "8000": { - "label": "Hello Remote World", - "onAutoForward": "notify" - } - }, - - // Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'. - // "otherPortsAttributes": { - // "onAutoForward": "silent" - // }, - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" - - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" -} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 314766e9..00000000 --- a/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -* text=auto eol=lf -*.{cmd,[cC][mM][dD]} text eol=crlf -*.{bat,[bB][aA][tT]} text eol=crlf diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3e759b75..00000000 --- a/.gitignore +++ /dev/null @@ -1,330 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ -**/Properties/launchSettings.json - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c69965a9..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Launch application", - "type": "php", - "request": "launch", - "program": "${workspaceFolder}/index.php", - "cwd": "${workspaceFolder}", - "port": 9000 - }, - { - "name": "Listen for XDebug", - "type": "php", - "request": "launch", - "port": 9000 - }, - { - "name": "Launch currently open script", - "type": "php", - "request": "launch", - "program": "${file}", - "cwd": "${fileDirname}", - "port": 9000 - } - ] -} \ No newline at end of file diff --git a/ExamenUF2/Respuestas.md b/ExamenUF2/Respuestas.md new file mode 100644 index 00000000..b9ee52e0 --- /dev/null +++ b/ExamenUF2/Respuestas.md @@ -0,0 +1,38 @@ +En PHP, una classe pot tenir múltiples constructors. +F solo tiene uno + +El $this s'utilitza per referenciar l'objecte actual dins d'una classe. +V + +Els atributs d'una classe sempre han de ser public. +F tambien puede ser privados + +Una funció dins d’una classe s’anomena mètode. +V (aunque una funcion como tal es un metodo independientemente donde este) + +Una classe pot instanciar-se sense un constructor. +F debes hacerlo para poder utilizar las variables que utilizaras en los metodos + +Els patrons de disseny són obligatoris si volem treballar amb POO + + +El tipat estricte en PHP impedeix assignar valors d’un tipus diferent al declarat. + + +El tipus INT pot contenir valors decimals en PHP. +F el INT es para numeros enteros + +Un objecte és una instància d’una classe. +V + +Mai poden haver dos instàncies amb el mateix nom. +V + +Defineix amb les teves paraules què fa serialize() i que fa unserialize(). +serialize() tranforma un objeto en una variable y unserialize() hace lo contrario + +En quin cas és útil i necessari? +para atribuir un objeto a la variable de una session + + + diff --git a/ExamenUF2/correccion.php b/ExamenUF2/correccion.php new file mode 100644 index 00000000..7377a6b4 --- /dev/null +++ b/ExamenUF2/correccion.php @@ -0,0 +1,70 @@ +marca = $marca; + $this->model = $model; + } + + function descripcio(){ + return "aquest cotche es un " . $this->marca . " " . $this->model; + + } + +} +$cotche = new Cotxe("Toyota", "Corolla"); +//echo Cotxe->descripcio(); +echo $cotxe->descripcio(); + +//El error estaba en que estas intentando utilizar la clase en vez de la variable para utilizar los metodos de la clase + + +class Persona{ + public string $nombre; + public int $edad; + + public function __construct(string $nombre, int $edad) + { + $this->nombre = $nombre; + $this->edad = $edad; + } + +} +$persona = new Persona("Maria","30"); +echo $persona->edad; + +//estas pasando un parametro que deberia ser INT como String +//edad no es un metodo que exista + + +class Calculadora{ + //debes poner aqui las variables con el public + //public $a; + //public $b; + + //falta aqui un constructor + + + //y aqui utilizas las variables del constructor + function sumar($a,$b){ + return $a + $b; + } + + function restar($a,$b){ + return $a - $b; + } +} +$calc = new Calculadora( + //Aqui se debe mandar que valores quieres +); +$calc->sumar(5,3 +//aqui no puedes mandar tu los parametros +); +$calc->restar(10,4 +//nuevamente no puedes mandar los parametros +); + +//Falta añadir algun sitio donde atrbuir las variable que queremos mandar, pero es que tampoco estamos mandando variables, ademas de que cuando utilizas una funcion en un objeto no puedes mandar parametros ya que los recoge cuando los envias +?> \ No newline at end of file diff --git a/ExamenUF2/minijuegos/minijuego1/adivinar.php b/ExamenUF2/minijuegos/minijuego1/adivinar.php new file mode 100644 index 00000000..53ad6132 --- /dev/null +++ b/ExamenUF2/minijuegos/minijuego1/adivinar.php @@ -0,0 +1,96 @@ +max = $max; + $this->min = $min; + $this->numeroSecreto = $numeroSecreto; + + if (!isset($_SESSION['contador'])) { + $_SESSION['contador'] = 0; + } + } + + public function generarNumeroSecreto() { + $this->numeroSecreto = rand(0,20); + $_SESSION['contador'] = 0; + } + + public function procesarAdivinanza(int $valor) { + $_SESSION['contador']++; + + if ($valor < $this->numeroSecreto) { + $this->min = $valor; + return "El número es mayor que " . $valor; + } elseif ($valor > $this->numeroSecreto) { + $this->max = $valor; + return "El número es menor que " . $valor; + } else { + $contador = $_SESSION['contador']; + $_SESSION['contador'] = 0; + return "¡Lo has adivinado en " . $contador . " intentos!"; + } + } + + public function getMax() { + return $this->max; + } + + public function getMin() { + return $this->min; + } + + public function getContador() { + return $_SESSION['contador']; + } +} + +$game = new JuegoAdivinar(); + +$mensaje = ''; +if ($_SERVER['REQUEST_METHOD'] == "GET") { + if (isset($_GET['num'])) { + $valor = (int) $_GET['num']; + $mensaje = $game->procesarAdivinanza($valor); + } + + if (isset($_GET['reset'])) { + $game->generarNumeroSecreto(); + $mensaje = "Nuevo número secreto generado."; + } +} +include "../../componentes/header.php" +?> + + + + + + + Juego Adivinar + + + + +

Juego de Adivinar el Número

+ +

+ +
+ + +
+ +
+ +
+ +
+ + + diff --git a/ExamenUF2/minijuegos/minijuego2/compra.php b/ExamenUF2/minijuegos/minijuego2/compra.php new file mode 100644 index 00000000..78948260 --- /dev/null +++ b/ExamenUF2/minijuegos/minijuego2/compra.php @@ -0,0 +1,104 @@ +nombre = $nombre; + $this->precio = $precio; + } + + public function informacion() { + return "Nombre: " . $this->nombre . ", Precio: " . $this->precio . "€"; + } +} + +class CarritoCompra { + public $productos = []; + + public function anyadirProducto($producto) { + $this->productos[] = $producto; + } + + public function calcularTotal() { + $total = 0; + foreach ($this->productos as $producto) { + $total += $producto->precio; + } + return $total; + } + + public function mostrarProductos() { + foreach ($this->productos as $producto) { + echo "" . $producto->nombre . "" . $producto->precio . "€"; + } + } +} + +if(!isset($_SESSION['carrito']) || !is_a($_SESSION['carrito'], 'CarritoCompra')) { + $_SESSION['carrito'] = new CarritoCompra(); +} + +if ($_SERVER["REQUEST_METHOD"] == "POST") { + $nombre = $_POST['nombre']; + $precio = $_POST['precio']; + + $producto = new Producto($nombre, $precio); + + $_SESSION['carrito']->anyadirProducto($producto); +} +include "../../componentes/header.php" +?> + + + + + + + Carrito de Compra + + + + +
+

Agregar Productos

+
+
+ + +
+ +
+ + +
+ + +
+ +

Productos en el carrito:

+ + + + + + + + + productos)) { + $_SESSION['carrito']->mostrarProductos(); + echo ""; + } else { + echo ""; + } + ?> + +
NombrePrecio
Total: " . $_SESSION['carrito']->calcularTotal() . "€
No hay productos en el carrito aún.
+
+ + + + diff --git a/ExamenUF2/minijuegos/minijuego3/formulario.php b/ExamenUF2/minijuegos/minijuego3/formulario.php new file mode 100644 index 00000000..a513e4c6 --- /dev/null +++ b/ExamenUF2/minijuegos/minijuego3/formulario.php @@ -0,0 +1,80 @@ +nombre = $nombre; + $this->edad = $edad; + $this->correo = $correo; + } + + public function validarDatos(){ + if (!is_int($this->edad) || $this->edad <= 0) { + return "L'edat no és vàlida. Ha de ser un número positiu."; + } + + return "Les dades són vàlides."; + } +} + +$error = ''; + +if ($_SERVER["REQUEST_METHOD"] == "POST") { + $nombre = $_POST['nombre']; + $edad = (int)$_POST['edad']; + $correo = $_POST['correo']; + + $usuario = new Usuario($nombre, $edad, $correo); + $resultat = $usuario->validarDatos(); + + if ($resultat !== "Les dades són vàlides.") { + $error = $resultat; + } else { + $_SESSION['usuario'] = [ + 'nombre' => $usuario->nombre, + 'edad' => $usuario->edad, + 'correo' => $usuario->correo + ]; + } +} +include "../../componentes/header.php" +?> + + + + + + + Formulario de Usuario + + + + + +

+ + + +

Usuari guardat:

+ + +
+ +

+ + +

+ + +

+ + +
+ + + diff --git a/ExamenUF2/minijuegos/minijuego4/facturas.php b/ExamenUF2/minijuegos/minijuego4/facturas.php new file mode 100644 index 00000000..15c5adc7 --- /dev/null +++ b/ExamenUF2/minijuegos/minijuego4/facturas.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4b1ad51b..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/Practicas/Patrons-de-disseny/assets/Estructural.png b/Practicas/Patrons-de-disseny/assets/Estructural.png new file mode 100644 index 00000000..7a8782db Binary files /dev/null and b/Practicas/Patrons-de-disseny/assets/Estructural.png differ diff --git a/Practicas/Patrons-de-disseny/assets/adaptable.png b/Practicas/Patrons-de-disseny/assets/adaptable.png new file mode 100644 index 00000000..76302b9c Binary files /dev/null and b/Practicas/Patrons-de-disseny/assets/adaptable.png differ diff --git a/Practicas/Patrons-de-disseny/assets/decomportamineto.png b/Practicas/Patrons-de-disseny/assets/decomportamineto.png new file mode 100644 index 00000000..d7e6d7a9 Binary files /dev/null and b/Practicas/Patrons-de-disseny/assets/decomportamineto.png differ diff --git a/Practicas/Patrons-de-disseny/assets/decreacion.png b/Practicas/Patrons-de-disseny/assets/decreacion.png new file mode 100644 index 00000000..53b413dc Binary files /dev/null and b/Practicas/Patrons-de-disseny/assets/decreacion.png differ diff --git a/Practicas/Patrons-de-disseny/comportament.php b/Practicas/Patrons-de-disseny/comportament.php new file mode 100644 index 00000000..c32a80d2 --- /dev/null +++ b/Practicas/Patrons-de-disseny/comportament.php @@ -0,0 +1,58 @@ + + + + + + + + Document + + + + + +
+

Patrones Estructurales

+
+
+ + +
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/creacion.php b/Practicas/Patrons-de-disseny/creacion.php new file mode 100644 index 00000000..9c5ed36e --- /dev/null +++ b/Practicas/Patrons-de-disseny/creacion.php @@ -0,0 +1,50 @@ + + + + + + + + Document + + + + + +
+

Patrones de Creacion

+
+ + +
+
+
+ +
+ + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/estructurals.php b/Practicas/Patrons-de-disseny/estructurals.php new file mode 100644 index 00000000..69e9d14e --- /dev/null +++ b/Practicas/Patrons-de-disseny/estructurals.php @@ -0,0 +1,53 @@ + + + + + + + + Document + + + + + +
+

Patrones Estructurales

+
+
+ + +
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/index.php b/Practicas/Patrons-de-disseny/index.php new file mode 100644 index 00000000..44df90b7 --- /dev/null +++ b/Practicas/Patrons-de-disseny/index.php @@ -0,0 +1,63 @@ + + + + + + + + Document + + + + + +
+
+ +
+
+ Imagen 1 +
+
Patrones Estructurales
+

Texto descriptivo para la primera card. Aquí puedes poner una breve descripción.

+ Ver más +
+
+
+ + +
+
+ Imagen 2 +
+
Patrones de Creacion
+

Texto descriptivo para la segunda card. Aquí puedes poner más detalles interesantes.

+ Ver más +
+
+
+ + +
+
+ Imagen 3 +
+
Patrones de Comportamineto
+

Texto descriptivo para la tercera card. Aquí puedes poner información relevante o interesante.

+ Ver más +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/patrons/comportamiento/iterator.php b/Practicas/Patrons-de-disseny/patrons/comportamiento/iterator.php new file mode 100644 index 00000000..c96c96d3 --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/comportamiento/iterator.php @@ -0,0 +1,21 @@ + +

Iterator

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+ + '; +?> diff --git a/Practicas/Patrons-de-disseny/patrons/comportamiento/observer.php b/Practicas/Patrons-de-disseny/patrons/comportamiento/observer.php new file mode 100644 index 00000000..b8f313a7 --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/comportamiento/observer.php @@ -0,0 +1,21 @@ + +

Observer

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+ + '; +?> diff --git a/Practicas/Patrons-de-disseny/patrons/comportamiento/strategy.php b/Practicas/Patrons-de-disseny/patrons/comportamiento/strategy.php new file mode 100644 index 00000000..62a1192b --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/comportamiento/strategy.php @@ -0,0 +1,21 @@ + +

Stragety

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+ + '; +?> diff --git a/Practicas/Patrons-de-disseny/patrons/creacion/factory.php b/Practicas/Patrons-de-disseny/patrons/creacion/factory.php new file mode 100644 index 00000000..11e86e1f --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/creacion/factory.php @@ -0,0 +1,43 @@ + + + + + + + Document + + + + + +
+

Factory

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+
+ + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/patrons/creacion/prototype.php b/Practicas/Patrons-de-disseny/patrons/creacion/prototype.php new file mode 100644 index 00000000..1606ff3c --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/creacion/prototype.php @@ -0,0 +1,43 @@ + + + + + + + Document + + + + + +
+

Prototype

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+
+ + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/patrons/creacion/singleton.php b/Practicas/Patrons-de-disseny/patrons/creacion/singleton.php new file mode 100644 index 00000000..d7939714 --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/creacion/singleton.php @@ -0,0 +1,43 @@ + + + + + + + Document + + + + + +
+

Singleton

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+
+ + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/patrons/estructurales/adapter.php b/Practicas/Patrons-de-disseny/patrons/estructurales/adapter.php new file mode 100644 index 00000000..3d90a241 --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/estructurales/adapter.php @@ -0,0 +1,43 @@ + + + + + + + Document + + + + + +
+

Adapter

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+
+ + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/patrons/estructurales/bridge.php b/Practicas/Patrons-de-disseny/patrons/estructurales/bridge.php new file mode 100644 index 00000000..4b19e5bf --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/estructurales/bridge.php @@ -0,0 +1,43 @@ + + + + + + + Document + + + + + +
+

Bridge

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+
+ + + + + \ No newline at end of file diff --git a/Practicas/Patrons-de-disseny/patrons/estructurales/decorator.php b/Practicas/Patrons-de-disseny/patrons/estructurales/decorator.php new file mode 100644 index 00000000..b37f42cc --- /dev/null +++ b/Practicas/Patrons-de-disseny/patrons/estructurales/decorator.php @@ -0,0 +1,43 @@ + + + + + + + Document + + + + + +
+

Decorator

+ +

Puntos en contra

+

Parrafo explicando

+ +

Soluciones

+

Parrafo explicando

+ +

Ejemplo

+

Parrafo explicando

+ +

Estructura

+ + +

Explicar estructura

+
+ + + + + \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex1.php b/Practicas/PractTeoricas/Pract1/ex1.php new file mode 100644 index 00000000..460f925b --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex1.php @@ -0,0 +1,20 @@ +titulo = $titulo; + $this->autor = $autor; + } + + public function descripcion(){ + return "El libro '$this->titulo' ha estado escrito por '$this->autor'"; + } + + } + $libro1 = new Libro("Cien años de soledad", "Gabriel Garcia Marquez"); + echo $libro1->descripcion(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex10.php b/Practicas/PractTeoricas/Pract1/ex10.php new file mode 100644 index 00000000..03318ba1 --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex10.php @@ -0,0 +1,50 @@ +nombre = $nombre; + $this->tipo = $tipo; + } + + + public function describir() { + return "Aquest és un " . $this->tipo . " anomenat " . $this->nombre . "."; + } +} +?> + + + + + Formulario Animal + + + +

Introduce el Animal

+ +
+ +

+ +

+ +
+ +Descripcion del Animal:"; + echo "

" . $animal->describir() . "

"; +} +?> + + + \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex2.php b/Practicas/PractTeoricas/Pract1/ex2.php new file mode 100644 index 00000000..e51a113f --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex2.php @@ -0,0 +1,29 @@ +titulo = $titulo; + } + if($autor != null){ + $this->autor = $autor; + } + } + + public function descripcion(){ + return "El libro '$this->titulo' ha estado escrito por '$this->autor'"; + } + + } + + $libro1 = new Libro(); + $libro2 = new Libro("Cien años de soledad", "Gabriel Garcia Marquez"); + + echo $libro1->descripcion(); + echo "
"; + echo $libro2->descripcion(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex3.php b/Practicas/PractTeoricas/Pract1/ex3.php new file mode 100644 index 00000000..bbe3f7fa --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex3.php @@ -0,0 +1,24 @@ +titulo = $titulo; + $this->autor = $autor; + } + + public function descripcion(){ + return "El libro '$this->titulo' ha estado escrito por '$this->autor'"; + } + + } + + $libro1 = new Libro("Cien años de soledad", "Gabriel Garcia Marquez"); + $libro2 = new Libro(); + + echo $libro1->descripcion(); + echo $libro2->descripcion(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex4.php b/Practicas/PractTeoricas/Pract1/ex4.php new file mode 100644 index 00000000..42f6f0be --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex4.php @@ -0,0 +1,31 @@ +titulo = $titulo; + $this->autor = $autor; + } + + public function descripcion(): string{ + return "El libro '$this->titulo' ha estado escrito por '$this->autor'"; + } + + public function getAutor(): string{ + return $this->autor; + } + + } + + $libro1 = new Libro("Cien años de soledad", "Gabriel Garcia Marquez"); + $libro2 = new Libro(); + + echo $libro1->descripcion(); + echo "
"; + echo $libro2->descripcion(); + + echo "
Autor del primer libro: " . $libro1->getAutor(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex5.php b/Practicas/PractTeoricas/Pract1/ex5.php new file mode 100644 index 00000000..c30aa18a --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex5.php @@ -0,0 +1,19 @@ +nombre = $nombre; + $this->edad = $edad; + } + + public function saludar(): string{ + return "Hola, soy $this->nombre y tengo $this->edad años"; + } + + } + $persona1 = new Persona("Anna", 25); + echo $persona1->saludar(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex6.php b/Practicas/PractTeoricas/Pract1/ex6.php new file mode 100644 index 00000000..e43a0867 --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex6.php @@ -0,0 +1,34 @@ +nombre = $nombre; + $this->edad = $edad; + } + + public function saludar(): string{ + return "Hola, soy $this->nombre y tengo $this->edad años"; + } + +} + +if($_SERVER['REQUEST_METHOD']== 'POST'){ + $nombre = $_POST['nombre']; + $autor = $_POST['edad']; + + $persona = new Persona($nombre,$edad); + + echo $persona->saludar(); +}else{ + echo'
+ Nom:
+ Edat:
+ +
'; +} + + +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex7.php b/Practicas/PractTeoricas/Pract1/ex7.php new file mode 100644 index 00000000..47b86b01 --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex7.php @@ -0,0 +1,21 @@ +nombre = $nombre; + $this->precio = $precio; + } + + public function mostrarPrecio(): string{ + return "El precio del producto '$this->nombre' es $this->precio €"; + } +} + +$producto1 = new Producto("portatil", 899.99); + +echo $producto1->mostrarPrecio(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex8.php b/Practicas/PractTeoricas/Pract1/ex8.php new file mode 100644 index 00000000..db50c470 --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex8.php @@ -0,0 +1,33 @@ +sumar(10, 5) . "
"; +echo "Resta: " . $calculadora->restar(10, 5) . "
"; +echo "Multiplicació: " . $calculadora->multiplicar(10, 5) . "
"; +echo "Divisió: " . $calculadora->dividir(10, 5) . "
"; +echo "Divisió per zero: " . $calculadora->dividir(10, 0) . "
"; + +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract1/ex9.php b/Practicas/PractTeoricas/Pract1/ex9.php new file mode 100644 index 00000000..b34a4dc1 --- /dev/null +++ b/Practicas/PractTeoricas/Pract1/ex9.php @@ -0,0 +1,51 @@ +nombre = $nombre; + $this->precio = $precio; + } + + public function mostrarPrecio(): string{ + return number_format($this->precio, 2, ',', '.') . " €"; + } +} + +$producto = [ + new Producto("Portatil",899.99), + new Producto("Telefono mobil",499.99), + new Producto("Auriculares",89.99), + new Producto("Tablet",329.50), + new Producto("Raton",15.99), +]; +?> + + + + + + Document + + + + + + + + + + + + + + + + + +
ProductoPrecio
nombre; ?>precio, 2, ',', '.'); ?> €
+ + \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract2/ex1.php b/Practicas/PractTeoricas/Pract2/ex1.php new file mode 100644 index 00000000..8c0d1ca9 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex1.php @@ -0,0 +1,20 @@ +marca = $marca; + $this->model = $model; + } + + public function descripcio() { + return "El cotxe és un " . $this->marca . " model " . $this->model . "."; + } +} + +$cotxe = new Cotxe("Toyota", "Corolla"); + +echo $cotxe->descripcio(); +?> diff --git a/Practicas/PractTeoricas/Pract2/ex10.php b/Practicas/PractTeoricas/Pract2/ex10.php new file mode 100644 index 00000000..21d8f8b7 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex10.php @@ -0,0 +1,47 @@ +nom = $nom; + $this->preu = $preu; + } +} +$productes = [ + new Producte("Portatil", 899.99), + new Producte("Telèfon mòbil", 499.99), + new Producte("Auriculars", 89.99), + new Producte("Tablet", 329.50), + new Producte("Ratolí", 15.99), +]; +?> + + + + + + Llista de Productes + + +

Llista de Productes

+ + + + + + + + + "; + echo ""; + echo ""; + echo ""; + } + ?> + +
Nom del ProductePreu (€)
" . $producte->nom . "" . number_format($producte->preu, 2, ',', '.') . "
+ + diff --git a/Practicas/PractTeoricas/Pract2/ex2.php b/Practicas/PractTeoricas/Pract2/ex2.php new file mode 100644 index 00000000..e8b5b19a --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex2.php @@ -0,0 +1,22 @@ +marca = $marca; + $this->model = $model; + } + + public function descripcio() { + return "El cotxe és un " . $this->marca . " model " . $this->model . "."; + } +} + +$cotxe = new Cotxe("Toyota", "Corolla"); +$cotxe1 = new Cotxe(); + +echo $cotxe->descripcio(); +echo $cotxe1->descripcio(); +?> diff --git a/Practicas/PractTeoricas/Pract2/ex3.php b/Practicas/PractTeoricas/Pract2/ex3.php new file mode 100644 index 00000000..7790c15b --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex3.php @@ -0,0 +1,20 @@ +nom = $nom; + $this->edat = $edat; + } + + public function benvinguda() { + return "Benvingut/da, " . $this->nom . "! Tens " . $this->edat . " anys."; + } +} + +$persona = new Persona("Joan", 25); + +echo $persona->benvinguda(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract2/ex4y5.php b/Practicas/PractTeoricas/Pract2/ex4y5.php new file mode 100644 index 00000000..9bb4eaa5 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex4y5.php @@ -0,0 +1,22 @@ +nom = $nom; + $this->edat = $edat; + } + + public function benvinguda(): string{ + return "Benvingut/da, " . $this->nom . "! Tens " . $this->edat . " anys."; + } +} + +$persona = new Persona("Joan", 25); +$persona1 = new Persona("Pepito", 8); + +echo $persona->benvinguda(); +echo $persona1->benvinguda(); +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract2/ex6.php b/Practicas/PractTeoricas/Pract2/ex6.php new file mode 100644 index 00000000..084e5d98 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex6.php @@ -0,0 +1,15 @@ +sumar(5.5, 3.2); + +echo "El resultat de la suma és: " . $resultat; +?> \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract2/ex7.php b/Practicas/PractTeoricas/Pract2/ex7.php new file mode 100644 index 00000000..63369a90 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex7.php @@ -0,0 +1,52 @@ + + + + + + Formulari Persona + + + +

Introduïu les dades de la persona

+ +
+ +

+ + +

+ + +
+ +nom = $nom; + $this->edat = $edat; + } + + public function mostrarDades() { + return "El nom de la persona és " . $this->nom . " i té " . $this->edat . " anys."; + } + } + + $persona = new Persona($nom, $edat); + + echo "

Dades de la persona:

"; + echo "

" . $persona->mostrarDades() . "

"; +} +?> + + + \ No newline at end of file diff --git a/Practicas/PractTeoricas/Pract2/ex8.php b/Practicas/PractTeoricas/Pract2/ex8.php new file mode 100644 index 00000000..37731138 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex8.php @@ -0,0 +1,21 @@ +nom = $nom; + $this->tipus = $tipus; + } + + public function descriure(): string { + return "L'animal es diu " . $this->nom . " i és un/a " . $this->tipus . "."; + } +} + +$animal = new Animal("Toby", "goss"); + +echo $animal->descriure(); +?> diff --git a/Practicas/PractTeoricas/Pract2/ex9.php b/Practicas/PractTeoricas/Pract2/ex9.php new file mode 100644 index 00000000..3e3df299 --- /dev/null +++ b/Practicas/PractTeoricas/Pract2/ex9.php @@ -0,0 +1,23 @@ +nom = $nom; + $this->tipus = $tipus; + } + + public function descriure(): string { + return "L'animal es diu " . $this->nom . " i és un/a " . $this->tipus . "."; + } + + public function saludar(): string { + return "Hola, sóc un/a " . $this->tipus . " i em dic " . $this->nom . "."; + } +} +$animal = new Animal("Bambo", "goss"); + +echo $animal->saludar(); +?> \ No newline at end of file diff --git a/Practicas/ProjectoBiblioteca/biblioteca.php b/Practicas/ProjectoBiblioteca/biblioteca.php new file mode 100644 index 00000000..dbf9c20e --- /dev/null +++ b/Practicas/ProjectoBiblioteca/biblioteca.php @@ -0,0 +1,25 @@ +libros[] = $libros; + } + public function agregarLibro($libro){ + $this->libros[] = $libro; + } + + public function mostrarLibro(){ + + } + + public function buscarLibro(){ + + } + +} \ No newline at end of file diff --git a/Practicas/ProjectoBiblioteca/index.php b/Practicas/ProjectoBiblioteca/index.php new file mode 100644 index 00000000..f13eb634 --- /dev/null +++ b/Practicas/ProjectoBiblioteca/index.php @@ -0,0 +1,62 @@ +agregarLibro($libro); + $_SESSION['biblioteca'] = serialize($biblioteca); + } + +?> + + + + + + Document + + + +
+
+ +
+

Añadir libros

+
+
+ + + + + + + + + +
+
+ +
+ +
+

Coleccion de Libros

+
+ +
+
+ +
+ +
+
+
+ + + \ No newline at end of file diff --git a/Practicas/ProjectoBiblioteca/libro.php b/Practicas/ProjectoBiblioteca/libro.php new file mode 100644 index 00000000..f0d83aba --- /dev/null +++ b/Practicas/ProjectoBiblioteca/libro.php @@ -0,0 +1,21 @@ +titulo = $titulo; + $this->autor = $autor; + $this->anyoPublicacion = $anyoPublicacion; + $this->foto = $foto; + } + + public function detalles(){ + /*Poner aqui la tarjeta*/ + return "El libro '$this->titulo' escrito por '$this->autor' fue publicado el '$this->anyoPublicacion'"; + } +} \ No newline at end of file diff --git a/Practicas/ProjectoJuego/docs/readme.md b/Practicas/ProjectoJuego/docs/readme.md new file mode 100644 index 00000000..e69de29b diff --git a/Practicas/ProjectoJuego/public/Componentes/footer.php b/Practicas/ProjectoJuego/public/Componentes/footer.php new file mode 100644 index 00000000..e69de29b diff --git a/Practicas/ProjectoJuego/public/Componentes/header.php b/Practicas/ProjectoJuego/public/Componentes/header.php new file mode 100644 index 00000000..7faae161 --- /dev/null +++ b/Practicas/ProjectoJuego/public/Componentes/header.php @@ -0,0 +1,29 @@ + + + +'; + +?> diff --git a/Practicas/ProjectoJuego/public/character.php b/Practicas/ProjectoJuego/public/character.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/public/character.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/public/combat.php b/Practicas/ProjectoJuego/public/combat.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/public/combat.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/public/final.php b/Practicas/ProjectoJuego/public/final.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/public/final.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/public/index.php b/Practicas/ProjectoJuego/public/index.php new file mode 100644 index 00000000..6dedea25 --- /dev/null +++ b/Practicas/ProjectoJuego/public/index.php @@ -0,0 +1,81 @@ + + + + + + + + Document + + + + +
+
+
+

Crea tu personaje

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/public/precombat.php b/Practicas/ProjectoJuego/public/precombat.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/public/precombat.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/classes/Juego.php b/Practicas/ProjectoJuego/src/classes/Juego.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/classes/Juego.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/classes/Jugador.php b/Practicas/ProjectoJuego/src/classes/Jugador.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/classes/Jugador.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/classes/Molde.php b/Practicas/ProjectoJuego/src/classes/Molde.php new file mode 100644 index 00000000..fab96423 --- /dev/null +++ b/Practicas/ProjectoJuego/src/classes/Molde.php @@ -0,0 +1,50 @@ +id = $id; + $this->nombre = $nombre; + $this->apodo = $apodo; + + $this->vida = $vida; + $this->ataque = $ataque; + $this->defensa = $defensa; + + $this->imagen = $imagen; + $this->habilidades = $habilidades; + } + + public function obtenerHabilidades(){ + implode(",", $this->habilidades); + } +} +if ($_SERVER['REQUEST_METHOD']== 'post'){ + $nombre = $_POST['nombre']; + $apodo = $_POST['apodo']; + $salud = $_POST['salud']; + $ataque = $_POST['ataque']; + $defensa = $_POST['defensa']; + $imagen = $_POST['imagen']; + $habilidades = $_POST['habilidades']; + + $personaje = new Personaje($nombre, $apodo, $salud, $ataque, $defensa, $imagen, $habilidades); + +} + +?> \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/classes/ObjetoEspecial.php b/Practicas/ProjectoJuego/src/classes/ObjetoEspecial.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/classes/ObjetoEspecial.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/config/config.php b/Practicas/ProjectoJuego/src/config/config.php new file mode 100644 index 00000000..98431174 --- /dev/null +++ b/Practicas/ProjectoJuego/src/config/config.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/controllers/CombatController.php b/Practicas/ProjectoJuego/src/controllers/CombatController.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/controllers/CombatController.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/controllers/CrearPersonajeController.php b/Practicas/ProjectoJuego/src/controllers/CrearPersonajeController.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/controllers/CrearPersonajeController.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/controllers/PrecombatController.php b/Practicas/ProjectoJuego/src/controllers/PrecombatController.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/controllers/PrecombatController.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/controllers/ResultatController.php b/Practicas/ProjectoJuego/src/controllers/ResultatController.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/controllers/ResultatController.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoJuego/src/controllers/SeleccionarController.php b/Practicas/ProjectoJuego/src/controllers/SeleccionarController.php new file mode 100644 index 00000000..86611d41 --- /dev/null +++ b/Practicas/ProjectoJuego/src/controllers/SeleccionarController.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Practicas/ProjectoUno/baraja.class.php b/Practicas/ProjectoUno/baraja.class.php new file mode 100644 index 00000000..6b1dc9d4 --- /dev/null +++ b/Practicas/ProjectoUno/baraja.class.php @@ -0,0 +1,38 @@ +barajaCartas[] = new Carta($i, $color); + } + $this->barajaCartas[] = new Carta('reverse', $color); + $this->barajaCartas[] = new Carta('skip', $color); + $this->barajaCartas[] = new Carta('picker', $color); + } + } + + public function mezclarBaraja(){ + shuffle($this->barajaCartas); + } + + public function pintarBaraja(){ + foreach($this->barajaCartas as $carta){ + echo $carta->pintar_carta(); + echo "
"; + } + } + public function pinta_baraja_girada() { + foreach ($this->barajaCartas as $carta) { + echo $carta->pinta_carta_girada(); + } + } + + +} + +?> \ No newline at end of file diff --git a/Practicas/ProjectoUno/carta.class.php b/Practicas/ProjectoUno/carta.class.php new file mode 100644 index 00000000..413d94dd --- /dev/null +++ b/Practicas/ProjectoUno/carta.class.php @@ -0,0 +1,33 @@ +numero = $numero; + $this->color = $color; + $this->index = $index; + } + + public function pintar_carta() { + $ruta = $this->numero . '_' . strtolower($this->color) . '.png'; + return 'Carta'; + } + + public function pintar_carta_link() { + $ruta = $this->numero . '_' . strtolower($this->color) . '.png'; + return 'Carta'; + } + + public function pinta_carta_girada() { + return 'Carta girada'; + } + + +} + +?> + diff --git a/Practicas/ProjectoUno/cartas_uno/0_blue.png b/Practicas/ProjectoUno/cartas_uno/0_blue.png new file mode 100644 index 00000000..4fd3b3e1 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/0_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/0_green.png b/Practicas/ProjectoUno/cartas_uno/0_green.png new file mode 100644 index 00000000..99b2676a Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/0_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/0_red.png b/Practicas/ProjectoUno/cartas_uno/0_red.png new file mode 100644 index 00000000..8a8d2242 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/0_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/0_yellow.png b/Practicas/ProjectoUno/cartas_uno/0_yellow.png new file mode 100644 index 00000000..cd7f9d14 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/0_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/1_blue.png b/Practicas/ProjectoUno/cartas_uno/1_blue.png new file mode 100644 index 00000000..e82fd6ca Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/1_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/1_green.png b/Practicas/ProjectoUno/cartas_uno/1_green.png new file mode 100644 index 00000000..1581f069 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/1_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/1_red.png b/Practicas/ProjectoUno/cartas_uno/1_red.png new file mode 100644 index 00000000..c378080a Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/1_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/1_yellow.png b/Practicas/ProjectoUno/cartas_uno/1_yellow.png new file mode 100644 index 00000000..2f01a37d Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/1_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/2_blue.png b/Practicas/ProjectoUno/cartas_uno/2_blue.png new file mode 100644 index 00000000..a7229aff Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/2_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/2_green.png b/Practicas/ProjectoUno/cartas_uno/2_green.png new file mode 100644 index 00000000..9895103f Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/2_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/2_red.png b/Practicas/ProjectoUno/cartas_uno/2_red.png new file mode 100644 index 00000000..fae98ce8 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/2_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/2_yellow.png b/Practicas/ProjectoUno/cartas_uno/2_yellow.png new file mode 100644 index 00000000..5511b56c Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/2_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/3_blue.png b/Practicas/ProjectoUno/cartas_uno/3_blue.png new file mode 100644 index 00000000..b514a51d Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/3_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/3_green.png b/Practicas/ProjectoUno/cartas_uno/3_green.png new file mode 100644 index 00000000..6a3edcb0 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/3_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/3_red.png b/Practicas/ProjectoUno/cartas_uno/3_red.png new file mode 100644 index 00000000..14625d5a Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/3_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/3_yellow.png b/Practicas/ProjectoUno/cartas_uno/3_yellow.png new file mode 100644 index 00000000..0849bd82 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/3_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/4_blue.png b/Practicas/ProjectoUno/cartas_uno/4_blue.png new file mode 100644 index 00000000..7b0df903 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/4_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/4_green.png b/Practicas/ProjectoUno/cartas_uno/4_green.png new file mode 100644 index 00000000..3ab9d7ee Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/4_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/4_red.png b/Practicas/ProjectoUno/cartas_uno/4_red.png new file mode 100644 index 00000000..9878abca Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/4_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/4_yellow.png b/Practicas/ProjectoUno/cartas_uno/4_yellow.png new file mode 100644 index 00000000..2b8b0cb9 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/4_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/5_blue.png b/Practicas/ProjectoUno/cartas_uno/5_blue.png new file mode 100644 index 00000000..c5d87fe7 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/5_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/5_green.png b/Practicas/ProjectoUno/cartas_uno/5_green.png new file mode 100644 index 00000000..6043fd75 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/5_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/5_red.png b/Practicas/ProjectoUno/cartas_uno/5_red.png new file mode 100644 index 00000000..95c9e2c8 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/5_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/5_yellow.png b/Practicas/ProjectoUno/cartas_uno/5_yellow.png new file mode 100644 index 00000000..426359de Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/5_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/6_blue.png b/Practicas/ProjectoUno/cartas_uno/6_blue.png new file mode 100644 index 00000000..bff36f1b Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/6_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/6_green.png b/Practicas/ProjectoUno/cartas_uno/6_green.png new file mode 100644 index 00000000..f4a10a0f Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/6_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/6_red.png b/Practicas/ProjectoUno/cartas_uno/6_red.png new file mode 100644 index 00000000..f0f1503f Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/6_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/6_yellow.png b/Practicas/ProjectoUno/cartas_uno/6_yellow.png new file mode 100644 index 00000000..4e271956 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/6_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/7_blue.png b/Practicas/ProjectoUno/cartas_uno/7_blue.png new file mode 100644 index 00000000..ebea0934 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/7_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/7_green.png b/Practicas/ProjectoUno/cartas_uno/7_green.png new file mode 100644 index 00000000..041a1c06 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/7_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/7_red.png b/Practicas/ProjectoUno/cartas_uno/7_red.png new file mode 100644 index 00000000..3d5e42a6 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/7_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/7_yellow.png b/Practicas/ProjectoUno/cartas_uno/7_yellow.png new file mode 100644 index 00000000..c95258b1 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/7_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/8_blue.png b/Practicas/ProjectoUno/cartas_uno/8_blue.png new file mode 100644 index 00000000..95fa9fe3 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/8_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/8_green.png b/Practicas/ProjectoUno/cartas_uno/8_green.png new file mode 100644 index 00000000..71dea9b5 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/8_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/8_red.png b/Practicas/ProjectoUno/cartas_uno/8_red.png new file mode 100644 index 00000000..a0573840 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/8_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/8_yellow.png b/Practicas/ProjectoUno/cartas_uno/8_yellow.png new file mode 100644 index 00000000..eaacabd9 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/8_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/9_blue.png b/Practicas/ProjectoUno/cartas_uno/9_blue.png new file mode 100644 index 00000000..10a65851 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/9_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/9_green.png b/Practicas/ProjectoUno/cartas_uno/9_green.png new file mode 100644 index 00000000..72ab7363 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/9_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/9_red.png b/Practicas/ProjectoUno/cartas_uno/9_red.png new file mode 100644 index 00000000..e40942c3 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/9_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/9_yellow.png b/Practicas/ProjectoUno/cartas_uno/9_yellow.png new file mode 100644 index 00000000..0b220add Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/9_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/carta_girada.png b/Practicas/ProjectoUno/cartas_uno/carta_girada.png new file mode 100644 index 00000000..196f8611 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/carta_girada.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/color_changer.png b/Practicas/ProjectoUno/cartas_uno/color_changer.png new file mode 100644 index 00000000..b77fecc6 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/color_changer.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/picker_blue.png b/Practicas/ProjectoUno/cartas_uno/picker_blue.png new file mode 100644 index 00000000..e2963ba1 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/picker_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/picker_green.png b/Practicas/ProjectoUno/cartas_uno/picker_green.png new file mode 100644 index 00000000..a6e5ca55 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/picker_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/picker_red.png b/Practicas/ProjectoUno/cartas_uno/picker_red.png new file mode 100644 index 00000000..2ba3ad6c Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/picker_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/picker_yellow.png b/Practicas/ProjectoUno/cartas_uno/picker_yellow.png new file mode 100644 index 00000000..cd24ea67 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/picker_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/reverse_blue.png b/Practicas/ProjectoUno/cartas_uno/reverse_blue.png new file mode 100644 index 00000000..06ef9b0c Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/reverse_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/reverse_green.png b/Practicas/ProjectoUno/cartas_uno/reverse_green.png new file mode 100644 index 00000000..0e7eb472 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/reverse_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/reverse_red.png b/Practicas/ProjectoUno/cartas_uno/reverse_red.png new file mode 100644 index 00000000..75b57267 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/reverse_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/reverse_yellow.png b/Practicas/ProjectoUno/cartas_uno/reverse_yellow.png new file mode 100644 index 00000000..b0c6c33e Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/reverse_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/skip_blue.png b/Practicas/ProjectoUno/cartas_uno/skip_blue.png new file mode 100644 index 00000000..5520e996 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/skip_blue.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/skip_green.png b/Practicas/ProjectoUno/cartas_uno/skip_green.png new file mode 100644 index 00000000..dc07bcba Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/skip_green.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/skip_red.png b/Practicas/ProjectoUno/cartas_uno/skip_red.png new file mode 100644 index 00000000..8c2b6c99 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/skip_red.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/skip_yellow.png b/Practicas/ProjectoUno/cartas_uno/skip_yellow.png new file mode 100644 index 00000000..a722d338 Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/skip_yellow.png differ diff --git a/Practicas/ProjectoUno/cartas_uno/video_fondo_uno.mp4 b/Practicas/ProjectoUno/cartas_uno/video_fondo_uno.mp4 new file mode 100644 index 00000000..8ef06a9c Binary files /dev/null and b/Practicas/ProjectoUno/cartas_uno/video_fondo_uno.mp4 differ diff --git a/Practicas/ProjectoUno/formulario_uno.php b/Practicas/ProjectoUno/formulario_uno.php new file mode 100644 index 00000000..c02d21d6 --- /dev/null +++ b/Practicas/ProjectoUno/formulario_uno.php @@ -0,0 +1,44 @@ + + + + + + + Formulario + + + + + + + +
+

Bienvenido al juego del Uno!

+ +
+
+ + +
+
+ + +
+ + +
+
+ + \ No newline at end of file diff --git a/Practicas/ProjectoUno/index.css b/Practicas/ProjectoUno/index.css new file mode 100644 index 00000000..e69de29b diff --git a/Practicas/ProjectoUno/index.php b/Practicas/ProjectoUno/index.php new file mode 100644 index 00000000..192b7093 --- /dev/null +++ b/Practicas/ProjectoUno/index.php @@ -0,0 +1,16 @@ +crear_baraja(); + +// Mezclar la baraja +$baraja->mezclarBaraja(); + +$baraja->pintarBaraja(); + + +?> \ No newline at end of file diff --git a/Practicas/ProjectoUno/jugador.class.php b/Practicas/ProjectoUno/jugador.class.php new file mode 100644 index 00000000..24901027 --- /dev/null +++ b/Practicas/ProjectoUno/jugador.class.php @@ -0,0 +1,22 @@ +mano[] = $carta; + } + + public function eliminar_carta($carta) { + array_shift($carta); // + } + + public function mostrar_ma() { + foreach ($this->mano as $carta) { + $carta->pinta_carta(); + } + } +} +?> \ No newline at end of file diff --git a/Practicas/ProjectoUno/partida.class.php b/Practicas/ProjectoUno/partida.class.php new file mode 100644 index 00000000..da68de74 --- /dev/null +++ b/Practicas/ProjectoUno/partida.class.php @@ -0,0 +1,48 @@ +numero_jugadores = $numero_jugadores; + $this->numero_cartas = $numero_cartas; + $this->turno = 0; + $this->baraja = new Baraja(); + $this->baraja->crear_baraja(); + $this->baraja->mezclarBaraja(); + $this->carta_en_mesa = $this->baraja->barajaCartas[0]; + $this->array_jugadores = []; + $this->constante_sentido = 1; // Sentido horario + } + + public function jugar() { + + + $jugadorActual = $this->array_jugadores[$this->turno]; + echo "Es el turno del jugador: " . $jugadorActual->nombre; + + // Muestra la carta en mesa + echo "Carta en mesa: "; + $this->carta_en_mesa->pinta_carta(); + } + + public function normas_uno() { + } + + public function cambiaTurno() { + // Cambiar turno dependiendo del sentido + if ($this->constante_sentido == 1) { + $this->turno = ($this->turno + 1) % $this->numero_jugadores; + } else { + $this->turno = ($this->turno - 1 + $this->numero_jugadores) % $this->numero_jugadores; + } + + echo "El siguiente turno es del jugador: " . $this->array_jugadores[$this->turno]->nombre; + } +} +?> \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 46e2e3c5..00000000 --- a/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Try Out Development Containers: PHP - -[![Open in Remote - Containers](https://img.shields.io/static/v1?label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode-remote-try-php) - -A **development container** is a running [Docker](https://www.docker.com) container with a well-defined tool/runtime stack and its prerequisites. You can try out development containers with **[GitHub Codespaces](https://github.com/features/codespaces)** or **[Visual Studio Code Remote - Containers](https://aka.ms/vscode-remote/containers)**. - -This is a sample project that lets you try out either option in a few easy steps. We have a variety of other [vscode-remote-try-*](https://github.com/search?q=org%3Amicrosoft+vscode-remote-try-&type=Repositories) sample projects, too. - -> **Note:** If you already have a Codespace or dev container, you can jump to the [Things to try](#things-to-try) section. - -## Setting up the development container - -### GitHub Codespaces -Follow these steps to open this sample in a Codespace: -1. Click the Code drop-down menu and select the **Open with Codespaces** option. -1. Select **+ New codespace** at the bottom on the pane. - -For more info, check out the [GitHub documentation](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace#creating-a-codespace). - -### VS Code Remote - Containers - -If you already have VS Code and Docker installed, you can click the badge above or [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode-remote-try-php) to get started. Clicking these links will cause VS Code to automatically install the Remote - Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. - -Follow these steps to open this sample in a container using the VS Code Remote - Containers extension: - -1. If this is your first time using a development container, please ensure your system meets the pre-reqs (i.e. have Docker installed) in the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started). - -2. To use this repository, you can either open the repository in an isolated Docker volume: - - - Press F1 and select the **Remote-Containers: Try a Sample...** command. - - Choose the "PHP" sample, wait for the container to start, and try things out! - > **Note:** Under the hood, this will use the **Remote-Containers: Clone Repository in Container Volume...** command to clone the source code in a Docker volume instead of the local filesystem. [Volumes](https://docs.docker.com/storage/volumes/) are the preferred mechanism for persisting container data. - - Or open a locally cloned copy of the code: - - - Clone this repository to your local filesystem. - - Press F1 and select the **Remote-Containers: Open Folder in Container...** command. - - Select the cloned copy of this folder, wait for the container to start, and try things out! - -## Things to try - -Once you have this sample opened, you'll be able to work with it like you would locally. - -> **Note:** This container runs as a non-root user with sudo access by default. Comment out `"remoteUser": "vscode"` in `.devcontainer/devcontainer.json` if you'd prefer to run as root. - -Some things to try: - -1. **Edit:** - - Open `index.php` - - Try adding some code and check out the language features. - - Notice that PHP debugging and IntelliSense are already included in the container since the `.devcontainer/devcontainer.json` lists `"felixfbecker.php-debug"`, `"bmewburn.vscode-intelephense-client"`, and `"mrmlnc.vscode-apache"` as extensions to install automatically when the container is created. -1. **Terminal:** Press ctrl+shift+\` and type `uname` and other Linux commands from the terminal window. -1. **Run and Debug:** - - Open `index.php` - - Add a breakpoint (e.g. on line 4). - - Press F5 to launch the app in the container. - - Once the breakpoint is hit, try hovering over variables, examining locals, and more. -1. **Running a server:** - - From the terminal, run `php -S 0.0.0.0:8000` - - Click "Open in Browser" in the notification that appears to access the web app on this new port. - - You can view an organized table of your forwarded ports in the 'Ports' view, which can be accessed with the command **Ports: Focus on Ports View**. - - Notice port 8000 in the 'Ports' view is labeled "Hello Remote World." In `devcontainer.json`, you can set `"portsAttributes"`, such as a label for your forwarded ports and the action to be taken when the port is autoforwarded. - - Look back at the terminal, and you should see the output from your site navigations. - - Edit the text on line 21 in `index.php` and refresh the page to see the changes immediately take effect. -1. **Attach debugger to the server:** - - Follow the previous steps to start up a PHP server and open a browser on port `8000` - - Press F1 and select the **View: Show Debug** command. - - Pick "Listen for XDebug" from the dropdown. - - Press F5 to attach the debugger. - - Add a breakpoint to `index.php` if you haven't already. - - Reload your browser window. - - Once the breakpoint is hit, try hovering over variables, examining locals, and more. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## License - -Copyright © Microsoft Corporation All rights reserved.
-Licensed under the MIT License. See LICENSE in the project root for license information. diff --git a/Teoria/sesion1.php b/Teoria/sesion1.php new file mode 100644 index 00000000..5d9ad6dd --- /dev/null +++ b/Teoria/sesion1.php @@ -0,0 +1,29 @@ +nombre; + } + public function NivelDePelea(){ + return $this->nombre . "tiene un nivel de pelea de ". $this->nivel_pelea; + } +} +$objeto1 = new Saiyajin(); +var_dump($objeto1); +$objeto2 = new Saiyajin(); +var_dump($objeto2); +echo "
"; +echo $objeto1->Saludar(); +echo '
'; +echo "Mi nivel de pelea es: ". $objeto1->NivelDePelea(); + +?> \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100644 index f15e9353..00000000 --- a/index.php +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Visual Studio Code Remote :: PHP - - - - - \ No newline at end of file