| @@ -0,0 +1,8 @@ | ||
| build.xml.data.CRC32=5f445691 | ||
| build.xml.script.CRC32=bdb084d1 | ||
| build.xml.stylesheet.CRC32=8064a381@1.80.1.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=5f445691 | ||
| nbproject/build-impl.xml.script.CRC32=3ae26027 | ||
| nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 |
| @@ -0,0 +1,74 @@ | ||
| 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.test.classpath=\ | ||
| ${run.test.classpath} | ||
| # \u0424\u0430\u0439\u043b\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 build.classes.dir, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0430\u0440\u0445\u0438\u0432\u0430 jar | ||
| dist.archive.excludes= | ||
| # This directory is removed when the project is cleaned: | ||
| dist.dir=dist | ||
| dist.jar=${dist.dir}/Flow_Control_Task_5.jar | ||
| dist.javadoc.dir=${dist.dir}/javadoc | ||
| excludes= | ||
| includes=** | ||
| jar.compress=false | ||
| javac.classpath= | ||
| # Space-separated list of extra javac options | ||
| javac.compilerargs= | ||
| javac.deprecation=false | ||
| javac.external.vm=true | ||
| javac.processorpath=\ | ||
| ${javac.classpath} | ||
| javac.source=1.8 | ||
| javac.target=1.8 | ||
| javac.test.classpath=\ | ||
| ${javac.classpath}:\ | ||
| ${build.classes.dir} | ||
| javac.test.processorpath=\ | ||
| ${javac.test.classpath} | ||
| javadoc.additionalparam= | ||
| javadoc.author=false | ||
| javadoc.encoding=${source.encoding} | ||
| javadoc.noindex=false | ||
| javadoc.nonavbar=false | ||
| javadoc.notree=false | ||
| javadoc.private=false | ||
| javadoc.splitindex=true | ||
| javadoc.use=true | ||
| javadoc.version=false | ||
| javadoc.windowtitle= | ||
| main.class=flow_control_task_5.Flow_Control_Task_5 | ||
| 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= | ||
| run.test.classpath=\ | ||
| ${javac.test.classpath}:\ | ||
| ${build.test.classes.dir} | ||
| source.encoding=UTF-8 | ||
| src.dir=src | ||
| test.src.dir=test |
| @@ -0,0 +1,15 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://www.netbeans.org/ns/project/1"> | ||
| <type>org.netbeans.modules.java.j2seproject</type> | ||
| <configuration> | ||
| <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> | ||
| <name>Flow_Control_Task_5</name> | ||
| <source-roots> | ||
| <root id="src.dir"/> | ||
| </source-roots> | ||
| <test-roots> | ||
| <root id="test.src.dir"/> | ||
| </test-roots> | ||
| </data> | ||
| </configuration> | ||
| </project> |
| @@ -0,0 +1,91 @@ | ||
| /* | ||
| * To change this license header, choose License Headers in Project Properties. | ||
| * To change this template file, choose Tools | Templates | ||
| * and open the template in the editor. | ||
| */ | ||
| package flow_control_task_5; | ||
| import java.util.Scanner; | ||
| import java.lang.Math; | ||
|
|
||
| /** | ||
| * This program is a game of Rock, Scissors and Paper. | ||
| * @MihailT | ||
| */ | ||
| public class Flow_Control_Task_5 { | ||
|
|
||
| /** | ||
| * @param args the command line arguments | ||
| */ | ||
| public static void main(String[] args) { | ||
| // TODO code application logic here | ||
| Scanner in = new Scanner(System.in); | ||
| int min = 1; | ||
| int max = 3; | ||
| int range = (max - min) + 1; | ||
| for (int i = 0; i < 999; i++){ | ||
| System.out.println("Enter the folowong values for you choice:"); | ||
| System.out.println("1 - scissors \n2 - rock \n3 - paper \n4 - exit"); | ||
| int humanChoice = in.nextInt(); | ||
| int machineChoice = (int)(Math.random()*range) + min; | ||
| switch (humanChoice){ | ||
| case (4): | ||
| i = 999; | ||
| break; | ||
| case (1): | ||
| System.out.print("Scissors -"); | ||
| switch (machineChoice){ | ||
| case (1): | ||
| System.out.println(" Scissors"); | ||
| System.out.println("Tie"); | ||
| break; | ||
| case (2): | ||
| System.out.println(" Rock"); | ||
| System.out.println("You lost"); | ||
| break; | ||
| case (3): | ||
| System.out.println(" Paper"); | ||
| System.out.println("You won"); | ||
| break; | ||
| } | ||
| break; | ||
| case (2): | ||
| System.out.print("Rock -"); | ||
| switch (machineChoice){ | ||
| case (1): | ||
| System.out.println(" Scissors"); | ||
| System.out.println("You won"); | ||
| break; | ||
| case (2): | ||
| System.out.println(" Rock"); | ||
| System.out.println("Tie"); | ||
| break; | ||
| case (3): | ||
| System.out.println(" Paper"); | ||
| System.out.println("You lost"); | ||
| break; | ||
| } | ||
| break; | ||
| case (3): | ||
| System.out.print("Paper -"); | ||
| switch (machineChoice){ | ||
| case (1): | ||
| System.out.println(" Scissors"); | ||
| System.out.println("You lost"); | ||
| break; | ||
| case (2): | ||
| System.out.println(" Rock"); | ||
| System.out.println("You won"); | ||
| break; | ||
| case (3): | ||
| System.out.println(" Paper"); | ||
| System.out.println("Tie"); | ||
| break; | ||
| } | ||
| break; | ||
|
|
||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
| } |