commit 57e30a5de9cc0946de3e57abe1312ecfe80047d9 Author: Soka_jplr Date: Wed Feb 28 07:55:43 2024 -0600 primer commit diff --git a/Paint-ASCII/build.xml b/Paint-ASCII/build.xml new file mode 100644 index 0000000..de30293 --- /dev/null +++ b/Paint-ASCII/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project Paint-ASCII. + + + diff --git a/Paint-ASCII/build/classes/.netbeans_automatic_build b/Paint-ASCII/build/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/Paint-ASCII/build/classes/.netbeans_update_resources b/Paint-ASCII/build/classes/.netbeans_update_resources new file mode 100644 index 0000000..e69de29 diff --git a/Paint-ASCII/build/classes/Paquete/Lienzo.class b/Paint-ASCII/build/classes/Paquete/Lienzo.class new file mode 100644 index 0000000..a5fed13 Binary files /dev/null and b/Paint-ASCII/build/classes/Paquete/Lienzo.class differ diff --git a/Paint-ASCII/build/classes/Paquete/LienzoAutomatico.class b/Paint-ASCII/build/classes/Paquete/LienzoAutomatico.class new file mode 100644 index 0000000..62a4019 Binary files /dev/null and b/Paint-ASCII/build/classes/Paquete/LienzoAutomatico.class differ diff --git a/Paint-ASCII/build/classes/Paquete/LienzoManuel.class b/Paint-ASCII/build/classes/Paquete/LienzoManuel.class new file mode 100644 index 0000000..790271b Binary files /dev/null and b/Paint-ASCII/build/classes/Paquete/LienzoManuel.class differ diff --git a/Paint-ASCII/build/classes/Paquete/Main.class b/Paint-ASCII/build/classes/Paquete/Main.class new file mode 100644 index 0000000..ac01173 Binary files /dev/null and b/Paint-ASCII/build/classes/Paquete/Main.class differ diff --git a/Paint-ASCII/build/classes/Paquete/xd.class b/Paint-ASCII/build/classes/Paquete/xd.class new file mode 100644 index 0000000..4b96c8f Binary files /dev/null and b/Paint-ASCII/build/classes/Paquete/xd.class differ diff --git a/Paint-ASCII/manifest.mf b/Paint-ASCII/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/Paint-ASCII/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/Paint-ASCII/nbproject/build-impl.xml b/Paint-ASCII/nbproject/build-impl.xml new file mode 100644 index 0000000..cabccef --- /dev/null +++ b/Paint-ASCII/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Paint-ASCII/nbproject/genfiles.properties b/Paint-ASCII/nbproject/genfiles.properties new file mode 100644 index 0000000..1b8cc41 --- /dev/null +++ b/Paint-ASCII/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=9afbea3b +build.xml.script.CRC32=6bb4f591 +build.xml.stylesheet.CRC32=f85dc8f2@1.108.0.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=9afbea3b +nbproject/build-impl.xml.script.CRC32=fcde2571 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.108.0.48 diff --git a/Paint-ASCII/nbproject/private/private.properties b/Paint-ASCII/nbproject/private/private.properties new file mode 100644 index 0000000..3d4728f --- /dev/null +++ b/Paint-ASCII/nbproject/private/private.properties @@ -0,0 +1,6 @@ +compile.on.save=true +<<<<<<< HEAD +user.properties.file=C:\\Users\\juanl\\AppData\\Roaming\\NetBeans\\19\\build.properties +======= +user.properties.file=C:\\Users\\juanl\\AppData\\Roaming\\NetBeans\\19\\build.properties +>>>>>>> 947a1e7da3733ddaf1e7a54eb212524e15f57ca0 diff --git a/Paint-ASCII/nbproject/private/private.xml b/Paint-ASCII/nbproject/private/private.xml new file mode 100644 index 0000000..8aa70af --- /dev/null +++ b/Paint-ASCII/nbproject/private/private.xml @@ -0,0 +1,12 @@ + + + + + + file:/C:/Users/juanl/Documents/NetBeansProjects/Paint-ASCII/src/Paquete/LienzoAutomatico.java + file:/C:/Users/juanl/Documents/NetBeansProjects/Paint-ASCII/src/Paquete/Main.java + file:/C:/Users/juanl/Documents/NetBeansProjects/Paint-ASCII/src/Paquete/Lienzo.java + file:/C:/Users/juanl/Documents/NetBeansProjects/Paint-ASCII/src/Paquete/LienzoManuel.java + + + diff --git a/Paint-ASCII/nbproject/project.properties b/Paint-ASCII/nbproject/project.properties new file mode 100644 index 0000000..a8a6f79 --- /dev/null +++ b/Paint-ASCII/nbproject/project.properties @@ -0,0 +1,95 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Paint-ASCII.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/Paint-ASCII +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs=\ --enable-preview +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=20 +javac.target=20 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=Paint-ASCII +main.class=Paquete.Main +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs=\ --enable-preview +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/Paint-ASCII/nbproject/project.xml b/Paint-ASCII/nbproject/project.xml new file mode 100644 index 0000000..a6e11be --- /dev/null +++ b/Paint-ASCII/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + Paint-ASCII + + + + + + + + + diff --git a/Paint-ASCII/src/Paquete/Lienzo.java b/Paint-ASCII/src/Paquete/Lienzo.java new file mode 100644 index 0000000..62983e8 --- /dev/null +++ b/Paint-ASCII/src/Paquete/Lienzo.java @@ -0,0 +1,42 @@ +package Paquete; + + +public abstract class Lienzo { + protected int largo; + protected int ancho; + protected String nombre; + + public Lienzo(int largo, int ancho) { + this.largo = largo; + this.ancho = ancho; + } + + public int getLargo() { + return largo; + } + + public int getAncho() { + return ancho; + } + + public void setLargo(int largo) { + this.largo = largo; + } + + public void setAncho(int ancho) { + this.ancho = ancho; + } + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + public abstract void crearLienzo(); + public abstract boolean pintar(); + public abstract void LimpiarConsola(); + public abstract void mostrarLienzo(); + public abstract boolean exportar(); + public abstract boolean eliminarC(); +} diff --git a/Paint-ASCII/src/Paquete/LienzoAutomatico.java b/Paint-ASCII/src/Paquete/LienzoAutomatico.java new file mode 100644 index 0000000..b113ed9 --- /dev/null +++ b/Paint-ASCII/src/Paquete/LienzoAutomatico.java @@ -0,0 +1,404 @@ + +package Paquete; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.util.Random; + +/** + * + * @author reyes + */ +public class LienzoAutomatico extends Lienzo { + + private String lienzo; + + public LienzoAutomatico(int largo, int ancho) { + super(largo, ancho); + } + + @Override + public void crearLienzo() { + String[] lienzoarrray = new String[20]; + + lienzoarrray[0] + = " _____ \n" + + " / ___ \\\n" + + " / / _ \\ \\\n" + + " /( /( /(_)\\ )\\ )\\\n" + + " ( \\ \\ ___ / / )\n" + + " ( \\ _____ / )\n" + + " /( )\\\n" + + "| \\ / |\n" + + "| \\ _______ / |\n" + + " \\ / \\ / \\ /\n" + + " \\/ | | \\/\n" + + " | | \n" + + " | |\n" + + " | |"; + + lienzoarrray[1] = "" + + ",;;;;;;;;;;;.\n" + + " ,;;;;;;;;;`````)\n" + + ",;;;;;;;;' (@) ,',\n" + + ";;;;;;;;') \\ ,\n" + + ";;;;;;;;_} _) ',\n" + + ";;;;;;' _;_______________\n" + + "`;;;;; ;_.---------------'\n" + + " `;;; (\n" + + " `;. )"; + lienzoarrray[2] = " |_|_|\n" + + " \\_|||;;_/\n" + + " \\d||%||%:b/ |_|_|\n" + + " \\d~|dO%|i::b/ \\_|||;;_/\n" + + " ._H||dSf|||%::H_. \\d|||||;:b/\n" + + " ._H@|dLF|}|;::H_. \\d||#H#|;::b/\n" + + " ._H||dXFt||;.:H_. ._H||#H#|||;::H_. \n" + + " ._?|{|P|||/;:.P_. ._H||#H#|||;::H_.\n" + + " ._Hy||t|||;:H_. ._H||#H#|||;::H_.\n" + + " ._?|x||T|;i:P_. ._?|||#||||;::P_.\n" + + " ._H||i||;:H_. ._H|||||||;:H_.\n" + + " ._H|\"|||;:H_. ._?||||||;::P_.\n" + + " .=================. ._H|||||;:H_.\n" + + " |;;|#H#|;;;;;;;;: | ._H|||||;:H_.\n" + + " .=================. .=================.\n" + + " |;|#H#|;;;;;;;: | |_________________|\n" + + " |;|#H#|;;;;;: | | |\n" + + " |;|#H#|;;;;;: | | |\n" + + " |;|#H#|;;;: | | |\n" + + " |;|#H#|;;;: | | |\n" + + " |;|#H#|;: | | |\n" + + " ========= |_________|"; + lienzoarrray[3] = " ,-._\n" + + " _.-' '--.\n" + + " .' _ -`\\_\n" + + " / .----.`_.'----'\n" + + " ;/ `\n" + + " /_;\n" + + "\n" + + " ._ ._ ._ ._\n" + + "_.-._)`\\_.-._)`\\_.-._)`\\_.-._)`\\_.-._"; + lienzoarrray[4] = " _._ _,-'\"\"`-._\n" + + "(,-.`._,'( |\\`-/|\n" + + " `-.-' \\ )-`( , o o)\n" + + " `- \\`_`\"'-"; + lienzoarrray[5] = "(\"`-''-/\").___..--''\"`-._ \n" + + " `6_ 6 ) `-. ( ).`-.__.`) \n" + + " (_Y_.)' ._ ) `._ `. ``-..-' \n" + + " _..`--'_..-_/ /--'_.'\n" + + " ((((.-'' ((((.' (((.-' "; + lienzoarrray[6] = " _________ . .\n" + + "(.. \\_ , |\\ /|\n" + + " \\ O \\ /| \\ \\/ /\n" + + " \\______ \\/ | \\ / \n" + + " vvvv\\ \\ | / |\n" + + " \\^^^^ == \\_/ |\n" + + " `\\_ === \\. |\n" + + " / /\\_ \\ / |\n" + + " |/ \\_ \\| /\n" + + " snd \\________/"; + lienzoarrray[7] = " sjw ..----.._ _\n" + + " .' .--. \"-.(O)_\n" + + "'-.__.-'\"'=:| , _)_ \\__ . c\\'-..\n" + + " ''------'---''---'-\""; + lienzoarrray[8] = "######################################################################################\n" + + "# # \n" + + "# ,.--------._ #\n" + + "# / ''. #\n" + + "# ,' \\ |\"\\ /\\ /\\ #\n" + + "# /\"| / \\ |__\" ( \\\\ // ) #\n" + + "# \"_\"| / z#####z \\ // \\ \\\\ // / #\n" + + "# \\\\ ##### ##------\". \\// \\_\\\\||||//_/ #\n" + + "# \\\\/-----\\ / \". \\ \\/ _ _ \\ #\n" + + "# \\| \\ | ,,--.. \\ \\/|(O)(O)| #\n" + + "# | ,.--._ \\ ( | ## \\) \\ \\/ | | #\n" + + "# |( ## )/ \\ `-....-// |///////////////_\\/ \\ / #\n" + + "# '--'.\" \\ \\ // |____| #\n" + + "# /' / ) --. \\ || / \\ #\n" + + "# ,..| \\.________/ `-.. \\ \\ \\| \\ 0 0 / #\n" + + "# _,##/ | ,/ / \\ \\ \\ \\ U / \\_//_/ #\n" + + "# :###.- | ,/ / \\ /' \"\"\\ .\\ ( / #\n" + + "# /####| | (.___________,---',/ | |\\=._____| |_/ #\n" + + "# /#####| | \\__|__|__|__|_,/ |####\\ | || #\n" + + "# /######\\ \\ \\__________/ /#####| \\ || #\n" + + "# /|#######`. `\\ /#######\\ | || #\n" + + "# /++\\#########\\ \\ _,' _/#########\\ | || #\n" + + "# /++++|#########| \\ .---.. ,/ ,'##########.\\|_|| Donkey By #\n" + + "# //++++|#########\\. \\. ,-/ ,'########,+++++\\\\_\\\\ Hard'96 #\n" + + "# /++++++|##########\\. '._ _,/ ,'######,''++++++++\\ #\n" + + "# |+++++++|###########| -----.\" _'#######' +++++++++++\\ #\n" + + "# |+++++++|############\\. \\\\ // /#######/++++ S@yaN +++\\ #\n" + + "# ________________________\\\\___//______________________________________ #\n" + + "# / ____________________________________________________________________) #\n" + + "# / / _ _ #\n" + + "# | | | | | | #\n" + + "# \\ \\ | | _ ____ ____ | | _ #\n" + + "# \\ \\ | || \\ / ___) / _ ) | | / ) #\n" + + "# _____) ) | | | | | | ( __ / | |< ( #\n" + + "# (______/ |_| |_| |_| \\_____) |_| \\_) #\n" + + "# 19.08.02 #\n" + + "######################################################################################"; + lienzoarrray[9] = " .-.\n" + + " |_:_|\n" + + " /(_Y_)\\\n" + + ". ( \\/M\\/ )\n" + + " '. _.'-/'-'\\-'._\n" + + " ': _/.--'[[[[]'--.\\_\n" + + " ': /_' : |::\"| : '.\\\n" + + " ': // ./ |oUU| \\.' :\\\n" + + " ': _:'..' \\_|___|_/ : :|\n" + + " ':. .' |_[___]_| :.':\\\n" + + " [::\\ | : | | : ; : \\\n" + + " '-' \\/'.| |.' \\ .;.' |\n" + + " |\\_ \\ '-' : |\n" + + " | \\ \\ .: : | |\n" + + " | \\ | '. : \\ |\n" + + " / \\ :. .; |\n" + + " / | | :__/ : \\\\\n" + + " | | | \\: | \\ | ||\n" + + " / \\ : : |: / |__| /|\n" + + " snd | : : :_/_| /'._\\ '--|_\\\n" + + " /___.-/_|-' \\ \\\n" + + " '-'"; + lienzoarrray[10] = "-\"'\"-.\n" + + " | | \n" + + " (`-._____.-')\n" + + " .. `-._____.-' ..\n" + + " .', :./'.== ==.`\\.: ,`.\n" + + " : ( : ___ ___ : ) ;\n" + + " '._.: |0| |0| :._.'\n" + + " / `-'_`-' \\\n" + + " _.| / \\ |._\n" + + " .'.-| ( ) |-.`.\n" + + " //' | .-\"`\"`-'\"`\"-. | `\\\\ \n" + + " || | `~\":-...-:\"~` | ||\n" + + " || \\. `---' ./ ||\n" + + " || '-._ _.-' ||\n" + + " / \\ _/ `~:~` \\_ / \\\n" + + "||||\\) .-' / \\ `-. (/||||\n" + + "\\||| (`.___.')-(`.___.') |||/\n" + + " '\"' jgs `-----' `-----' '\"'"; + lienzoarrray[11] = ".-\"\". _____ .\"\"-.\n" + + " //.==.\\ (*****) /.==.\\\\\n" + + ";//:::'||,;;;;;,||.:::\\\\;\n" + + "||::::.\\((((/\\)))/.::::||\n" + + "||:::. )))a a((( .:::||\n" + + "||:::. ((( ^ ))) ':::||\n" + + "||::. )))-^-((( .:::||\n" + + "||::' (((\\\\_//))) .::||\n" + + "||::. / \\_/ \\ '::||\n" + + "||:: / \\ ::||\n" + + "||::/ | | \\::||\n" + + "||:/ ; ; \\:||\n" + + "||/ }===o={ \\||\n" + + "|`-,_ ; ( ; _,-'|\n" + + "||(_/'._| ) |_.'\\_)||\n" + + "||::. || ( || .::||\n" + + "||::. / | ) | \\ '::||\n" + + "||:' | | | | .:||\n" + + "||::/ | | \\::||\n" + + ";|:| | | |:|;\n" + + " \\/ | | \\/\n" + + " jgs | |\n" + + " |:.:.:.:|\n" + + " :':':':':"; + lienzoarrray[12] = " _.--\"\"`-..\n" + + " ,' `.\n" + + " ,' __ `.\n" + + " /| \" __ \\\n" + + " , | / |. .\n" + + " |,' !_.'| |\n" + + " ,' ' | |\n" + + " / |`--'| |\n" + + " | `---' |\n" + + " . , | ,\".\n" + + " ._ ' _' | , ' \\ `\n" + + " `.. `.`-...___,...---\"\" | __,. ,`\" L,|\n" + + " |, `- .`._ _,-,.' . __.-'-. / . , \\\n" + + "-:.. `. `-..--_.,.< `\" / `. `-/ | .\n" + + " `, \"\"\"\"' `. ,' | | ',,\n" + + " `. ' ' / ' |'. |/\n" + + " `. | \\ _,-' | ''\n" + + " `._' \\ '\"\\ . |\n" + + " | ' \\ `._ ,'\n" + + " | ' \\ .'|\n" + + " | . \\ | |\n" + + " | | L ,' |\n" + + " ` | | / '\n" + + " \\ | | ,' /\n" + + " ,' \\ | _.._ ,-..___,..-' ,'\n" + + " / . . `! ,j'\n" + + " / `. / . .'/\n" + + " . `. / | _.'.'\n" + + " `. 7`'---' |------\"'_.'\n" + + " _,.`,_ _' ,''-----\"'\n" + + " _,-_ ' `. .' ,\\\n" + + " -\" /`. _,' | _ _ _.|\n" + + " \"\"--'---\"\"\"\"\"' `' '! |! /\n" + + " `\" \" -' mh"; + lienzoarrray[13] = " T\\ T\\\n" + + " | \\| \\\n" + + " | | :\n" + + " _____I__I |\n" + + " .' '.\n" + + " .' '\n" + + " | .. '\n" + + " | /__. |\n" + + " :.' -' |\n" + + " /__. |\n" + + " /__, \\ |\n" + + " |__\\ _| |\n" + + " : '\\ .'| |\n" + + " |___|_,,,/ | | _..--.\n" + + " ,--_- | /' \\../ / /\\\\\n" + + " ,'|_ I---| 7 ,,,_/ / , / _\\\\\n" + + " ,-- 7 \\| / ___..,,/ / , ,_/ '-----.\n" + + " / , \\ |/ ,____,,,__,,__/ '\\\n" + + ", , \\__,,/ |\n" + + "| '. _..---.._ !.\n" + + "! | .' z_M__s. '. |\n" + + ".:' | (-_ _--') : L !\n" + + ".'. '. Y _.' \\, :\n" + + " . '-----' ! .\n" + + " . / \\ . ."; + lienzoarrray[14] = " __,__\n" + + " .--. .-\" \"-. .--.\n" + + " / .. \\/ .-. .-. \\/ .. \\\n" + + " | | '| / Y \\ |' | |\n" + + " | \\ \\ \\ 0 | 0 / / / |\n" + + " \\ '- ,\\.-\"`` ``\"-./, -' /\n" + + " `'-' /_ ^ ^ _\\ '-'`\n" + + " .--'| \\._ _ _./ |'--. \n" + + " /` \\ \\.-. / / `\\\n" + + " / '._/ |-' _.' \\\n" + + " / ; /--~' | \\\n" + + " / .'\\|.-\\--. \\ \\\n" + + " / .'-. /.-.;\\ |\\|'~'-.|\\ \\\n" + + " \\ `-./`|_\\_/ ` `\\'. \\\n" + + " '. ; ___) '.`; /\n" + + " '-.,_ ; ___) \\/ /\n" + + " \\ ``'------'\\ \\ ` /\n" + + " '. \\ '. | ;/_\n" + + "jgs ___> '. \\_ _ _/ , '--.\n" + + " .' '. .-~~~~~-. / |--'`~~-. \\\n" + + " // / .---'/ .-~~-._/ / / /---..__.' /\n" + + " ((_(_/ / / (_(_(_(---.__ .'\n" + + " | | _ `~~`\n" + + " | | \\'.\n" + + " \\ '....' |\n" + + " '.,___.'"; + lienzoarrray[15] = " `|. \n" + + " |:\\-, .| \\.\n" + + " |: `.------------------------------------.\n" + + " / / o o o o o o o o o o o o o.-.o o (_`. \n" + + "/_ \\_ . .= |'| `) \n" + + " ``\"\"\"\"\"\"\"\"\"\"\"// / \"\"\"\"\" `\"\"\"------\"'"; + lienzoarrray[16] = " _.._ _..---.\n" + + " .-\" ;-\" \\\n" + + " / / |\n" + + "| | _= |\n" + + "; _.-'\\__.-') |\n" + + " `-' | | ;\n" + + " | /; / _,\n" + + " .-.;.-=-./-\"\"-.-` _`\n" + + " / | \\ \\-` `,\n" + + " | | | |\n" + + " |____|______| |\n" + + " \\0 / \\0 / /\n" + + " .--.-\"\"-.`--' .'\n" + + " (# ) , \\\n" + + " ('--' /\\` \\\n" + + " \\ ,, .' \\\n" + + " `-._ _.'\\ \\\n" + + "jgs `\"\"` \\ \\"; + lienzoarrray[17] = " _..-----._\n" + + " .' '.\n" + + " / \\\n" + + " | ;\n" + + " | |\n" + + " \\ |\n" + + " \\ ;\n" + + " _..----' /\n" + + " .`-. .-'``'-. .-'\n" + + " .'_ ` _ '. `'.\n" + + " / _` _ ` \\ \\ _...._\n" + + " _ | / \\ / \\ | | .-' `'.\n" + + " / \\ | | /| | /| | ;' \\\n" + + " | |_\\ \\_|/ \\_|/ / ;\n" + + " .\\_/ `'-. /_...._ |\n" + + "/ ` `\\ |\n" + + "| __ | /\n" + + " \\ / ` //'. .'\n" + + " '._ .' .' `'-...-'`\n" + + " `\"'-.,__ ___.-' .-'\n" + + " jgs `-._```` __..--'`\n" + + " ``````"; + lienzoarrray[18] = " __\n" + + " .-' |\n" + + " / <\\|\n" + + " / \\'\n" + + " |_.- o-o\n" + + " / C -._)\\\n" + + " /', |\n" + + "| `-,_,__,'\n" + + "(,,)====[_]=|\n" + + " '. ____/\n" + + " | -|-|_\n" + + " |____)_) [n4biS]"; + + Random random = new Random(); + int numrandom = random.nextInt(18); + lienzo = lienzoarrray[numrandom]; + System.out.println("Tamañno del liezoarray es: ´" + lienzoarrray[numrandom].length()); + System.out.println("Tamaño del lienzo es: " + lienzo.length()); + System.out.println(lienzo); + } + + @Override + public boolean pintar() { + + return false; + + } + + @Override + public void LimpiarConsola() { + + } + + @Override + public void mostrarLienzo() { + crearLienzo(); + } + + @Override + public boolean exportar() { + File archivo = null; + FileWriter fw = null; + BufferedWriter bw = null; + try{ + archivo = new File("./"+nombre+".txt"); + fw = new FileWriter(archivo); + bw = new BufferedWriter(fw); + for(int i = 1; i<100; i++){ + bw.write(lienzo); + bw.write("\n"); + } + bw.flush(); + fw.close(); + }catch(Exception e){ + System.out.println(e.getMessage()); + } + return false; + + } + + @Override + public boolean eliminarC() { + + return false; + + } + +} diff --git a/Paint-ASCII/src/Paquete/LienzoManuel.java b/Paint-ASCII/src/Paquete/LienzoManuel.java new file mode 100644 index 0000000..6fdb5b4 --- /dev/null +++ b/Paint-ASCII/src/Paquete/LienzoManuel.java @@ -0,0 +1,126 @@ +package Paquete; + +import java.io.*; + +public class LienzoManuel extends Lienzo{ + + private char [][] matriz; + + public LienzoManuel(int largo, int ancho) { + super(largo, ancho); + this.matriz = new char [this.largo][this.ancho]; + } + + public char[][] getMatriz() { + return matriz; + } + + public void setMatriz(char[][] matriz) { + this.matriz = matriz; + } + + @Override + public void crearLienzo() { + for(int i = 1; i=largo || fila<=0 || fila>=ancho){ + respuesta = false; + }else{ + matriz[columna][fila] = c; + respuesta = true; + } + return respuesta; + } + + @Override + public void LimpiarConsola() { + for (int i = 0; i < 50; i++) { + System.out.println(); + } + } + + @Override + public void mostrarLienzo() { + for(int i = 0; i=largo || fila<=0 || fila>=ancho){ + respuesta = false; + }else{ + matriz[columna][fila] = ' '; + respuesta = true; + } + return respuesta; + } + + @Override + public boolean pintar() { + return false; + } + + @Override + public boolean eliminarC() { + return false; + } + + public boolean eliminarTL(){ + crearLienzo(); + return true; + } +} diff --git a/Paint-ASCII/src/Paquete/Main.java b/Paint-ASCII/src/Paquete/Main.java new file mode 100644 index 0000000..a66957b --- /dev/null +++ b/Paint-ASCII/src/Paquete/Main.java @@ -0,0 +1,145 @@ +package Paquete; + +import java.io.IOException; +import java.util.InputMismatchException; +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) throws IOException { + int largo; + int ancho; + int x; + int y; + int opcion; + int menu; + char caracter; + boolean bandera = true; + boolean bandera2 = true; + boolean bandera3 = true; + Scanner lectura = new Scanner(System.in); + while (bandera) { + System.out.println("Bienvenido para empezar con el programa. Elige una Opción"); + System.out.println("1)Pintar ASCII"); + System.out.println("2)ASCII-Random"); + System.out.println("3)Salir"); + + menu = obtenerEntero(lectura); + switch (menu) { + case 1: + System.out.println("Ingrese el ancho del lienzo: "); + ancho = obtenerEntero(lectura); + System.out.println("Ingrese el largo del lienzo: "); + largo = obtenerEntero(lectura); + if (ancho > 0 && largo > 0) { + LienzoManuel l = new LienzoManuel(largo + 1, ancho + 1); + String nombrel; + l.crearLienzo(); + l.mostrarLienzo(); + while (bandera2) { + System.out.println("Escoge una opcion"); + System.out.println("1)Pintar un caracter"); + System.out.println("2)Borrar un Caracter"); + System.out.println("3)Exportar lienzo"); + System.out.println("4)Borrar todo el Lienzo"); + System.out.println("5)Salir al menu Principal"); + opcion = obtenerEntero(lectura); + switch (opcion) { + case 1: + System.out.println("Da la cordenada en X:"); + x = obtenerEntero(lectura); + System.out.println("Da la cordenada en Y:"); + y = obtenerEntero(lectura); + System.out.println("Da el caracter:"); + caracter = lectura.next().charAt(0); + l.pintar(y, x, caracter); + l.LimpiarConsola(); + break; + case 2: + System.out.println("Da la cordenada en X:"); + x = obtenerEntero(lectura); + System.out.println("Da la cordenada en Y:"); + y = obtenerEntero(lectura); + l.eliminarC(y, x); + System.out.println("Caracter eliminado"); + break; + case 3: + lectura.nextLine(); + System.out.println("Ponle un nombre al lienzo"); + nombrel = lectura.nextLine(); + l.setNombre(nombrel); + if (l.exportar()) { + System.out.println("Exportado correctamente"); + } + break; + case 4: + l.crearLienzo(); + break; + case 5: + System.out.println("Regresando al menu principal"); + bandera2 = false; + break; + default: + System.out.println("ERROR. Opcion incorrecta"); + } + l.mostrarLienzo(); + } + } else { + System.out.println("ERROR. Solo acepta numeros positivos :("); + System.out.println(); + } + break; + case 2: + while (bandera3) { + System.out.println("Escoge una opcion"); + System.out.println("1)Mostrar"); + System.out.println("2)Exportar"); + System.out.println("3)Salir"); + opcion = obtenerEntero(lectura); + LienzoAutomatico la = new LienzoAutomatico(100, 100); + switch (opcion) { + case 1: + la.mostrarLienzo(); + break; + case 2: + String nombrea; + lectura.nextLine(); + System.out.println("Ponle un nombre al lienzo"); + nombrea = lectura.nextLine(); + la.setNombre(nombrea); + if (la.exportar()) { + System.out.println("Exportado correctamente"); + } + break; + case 3: + System.out.println("Regresando al menu principal"); + bandera3 = false; + break; + default: + System.out.println("ERROR. Opcion incorrecta"); + } + } + break; + case 3: + System.out.println("Hasta Luego"); + bandera = false; + break; + default: + System.out.println("ERROR. Opcion incorrecta"); + } + } + } + + public static int obtenerEntero(Scanner lectura) { + while (true) { + try { + return lectura.nextInt(); + } catch (InputMismatchException e) { + System.out.println("ERROR. Debes ingresar un número entero."); + System.out.println("Por favor, intenta nuevamente:"); + lectura.next(); // Limpiar el búfer de entrada + + } + } + } +}