commit d7dbb0b0530ce436cb3630d22b169a68843f136d Author: Sherwin Price Date: Thu Feb 5 10:51:59 2026 -0500 initial tictactoe diff --git a/.gradle/9.0.0/checksums/checksums.lock b/.gradle/9.0.0/checksums/checksums.lock new file mode 100644 index 0000000..64ac93b Binary files /dev/null and b/.gradle/9.0.0/checksums/checksums.lock differ diff --git a/.gradle/9.0.0/checksums/md5-checksums.bin b/.gradle/9.0.0/checksums/md5-checksums.bin new file mode 100644 index 0000000..6fc4842 Binary files /dev/null and b/.gradle/9.0.0/checksums/md5-checksums.bin differ diff --git a/.gradle/9.0.0/checksums/sha1-checksums.bin b/.gradle/9.0.0/checksums/sha1-checksums.bin new file mode 100644 index 0000000..57aef4a Binary files /dev/null and b/.gradle/9.0.0/checksums/sha1-checksums.bin differ diff --git a/.gradle/9.0.0/executionHistory/executionHistory.bin b/.gradle/9.0.0/executionHistory/executionHistory.bin new file mode 100644 index 0000000..4aac606 Binary files /dev/null and b/.gradle/9.0.0/executionHistory/executionHistory.bin differ diff --git a/.gradle/9.0.0/executionHistory/executionHistory.lock b/.gradle/9.0.0/executionHistory/executionHistory.lock new file mode 100644 index 0000000..70977ac Binary files /dev/null and b/.gradle/9.0.0/executionHistory/executionHistory.lock differ diff --git a/.gradle/9.0.0/fileChanges/last-build.bin b/.gradle/9.0.0/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/9.0.0/fileChanges/last-build.bin differ diff --git a/.gradle/9.0.0/fileHashes/fileHashes.bin b/.gradle/9.0.0/fileHashes/fileHashes.bin new file mode 100644 index 0000000..b6b6513 Binary files /dev/null and b/.gradle/9.0.0/fileHashes/fileHashes.bin differ diff --git a/.gradle/9.0.0/fileHashes/fileHashes.lock b/.gradle/9.0.0/fileHashes/fileHashes.lock new file mode 100644 index 0000000..b74c379 Binary files /dev/null and b/.gradle/9.0.0/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.0.0/fileHashes/resourceHashesCache.bin b/.gradle/9.0.0/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..798ab2c Binary files /dev/null and b/.gradle/9.0.0/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/9.0.0/gc.properties b/.gradle/9.0.0/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/9.3.1/checksums/checksums.lock b/.gradle/9.3.1/checksums/checksums.lock new file mode 100644 index 0000000..c9ba883 Binary files /dev/null and b/.gradle/9.3.1/checksums/checksums.lock differ diff --git a/.gradle/9.3.1/executionHistory/executionHistory.bin b/.gradle/9.3.1/executionHistory/executionHistory.bin new file mode 100644 index 0000000..033bb53 Binary files /dev/null and b/.gradle/9.3.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/9.3.1/executionHistory/executionHistory.lock b/.gradle/9.3.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..03f5401 Binary files /dev/null and b/.gradle/9.3.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/9.3.1/fileChanges/last-build.bin b/.gradle/9.3.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/9.3.1/fileChanges/last-build.bin differ diff --git a/.gradle/9.3.1/fileHashes/fileHashes.bin b/.gradle/9.3.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..dc12786 Binary files /dev/null and b/.gradle/9.3.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/9.3.1/fileHashes/fileHashes.lock b/.gradle/9.3.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..b557d37 Binary files /dev/null and b/.gradle/9.3.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.3.1/fileHashes/resourceHashesCache.bin b/.gradle/9.3.1/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..c7ced0e Binary files /dev/null and b/.gradle/9.3.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/9.3.1/gc.properties b/.gradle/9.3.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..5287a7b Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..228c6b5 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Feb 04 11:28:38 EST 2026 +gradle.version=9.3.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..3aba385 Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/configuration-cache/8u1h9m9t6aml5eqhpcowucnhr/candidates.bin b/.gradle/configuration-cache/8u1h9m9t6aml5eqhpcowucnhr/candidates.bin new file mode 100644 index 0000000..add16da --- /dev/null +++ b/.gradle/configuration-cache/8u1h9m9t6aml5eqhpcowucnhr/candidates.bin @@ -0,0 +1 @@ +e39dbea4-1bfc-4104-ae7e-6b0dea431c3 \ No newline at end of file diff --git a/.gradle/configuration-cache/configuration-cache.lock b/.gradle/configuration-cache/configuration-cache.lock new file mode 100644 index 0000000..499ab55 Binary files /dev/null and b/.gradle/configuration-cache/configuration-cache.lock differ diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/.globals.work.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/.globals.work.bin new file mode 100644 index 0000000..871c6c1 --- /dev/null +++ b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/.globals.work.bin @@ -0,0 +1 @@ +o06 "P!t \ No newline at end of file diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/.strings.work.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/.strings.work.bin new file mode 100644 index 0000000..ebe7af4 Binary files /dev/null and b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/.strings.work.bin differ diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/_lib.work.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/_lib.work.bin new file mode 100644 index 0000000..5282c4b --- /dev/null +++ b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/_lib.work.bin @@ -0,0 +1,2 @@ +Lag"AUP=8l۩08.QQ;Y5+5Hi(E L`)LL~17&5w=!te +8iceTw~}؛Su? 2 _ΉƋiNP=whZ>n$U \ No newline at end of file diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/buildfingerprint.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/buildfingerprint.bin new file mode 100644 index 0000000..6ece3b0 Binary files /dev/null and b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/buildfingerprint.bin differ diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/classloaderscopes.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/classloaderscopes.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/classloaderscopes.bin differ diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/entry.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/entry.bin new file mode 100644 index 0000000..ceb838b Binary files /dev/null and b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/entry.bin differ diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/projectfingerprint.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/projectfingerprint.bin new file mode 100644 index 0000000..356dc37 Binary files /dev/null and b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/projectfingerprint.bin differ diff --git a/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/work.bin b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/work.bin new file mode 100644 index 0000000..0ff932a --- /dev/null +++ b/.gradle/configuration-cache/e39dbea4-1bfc-4104-ae7e-6b0dea431c3f/work.bin @@ -0,0 +1,2 @@ +TZkxm E)SB@ₜԪJ:Ű0Ck9rnB<e&FK$)1j':&䬷埆NPuh89Rՠf7}ÁegߩO4_{ߍK5b>Z}^CG3KJsiƇd4٫S0=+u{mEpx9apP,ɂjvt)ät7GVh;تDc|!#-bZ*%5盳us`t3&EMR +k*,Ņ1EƕL^Z6Fg?ɱ /D&p$J.W&'Eh^63"]Q.&؀aH7ʗTxYRt猦YQ/O + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..651114c --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,10 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format + +[versions] +commons-math3 = "3.6.1" +guava = "33.4.6-jre" + +[libraries] +commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" } +guava = { module = "com.google.guava:guava", version.ref = "guava" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..8bdaf60 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..37f78a6 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..ef07e01 --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..5eed7ee --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lib/build.gradle b/lib/build.gradle new file mode 100644 index 0000000..1b4701a --- /dev/null +++ b/lib/build.gradle @@ -0,0 +1,53 @@ +/* +*/ + +plugins { + // Apply the java-library plugin for API and implementation separation. + id 'application' + + id("org.owasp.dependencycheck") version "12.2.0" +} + +group = 'edu.tictactoe' +version = '1.0' + +application { + mainClass = 'edu.tictactoe.App' +} + +sourceSets { + main { + java { + srcDirs = ['src/main/java'] + } + resources { + srcDirs = ['src/main/resources'] + } + } +} + +repositories { + // Use Maven Central for resolving dependencies. + mavenCentral() +} + +dependencies { + +} + +jar { + manifest { + attributes 'Main-Class': application.mainClass + } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +} + +tasks.named('jar') { + manifest { + attributes('Implementation-Title': application.mainClass, + 'Implementation-Version': 1.0, + 'Main-Class': application.mainClass, + 'Class-Path': 'edu.tictactoe .' ) + } +} diff --git a/lib/build/classes/java/main/edu/tictactoe/App$1.class b/lib/build/classes/java/main/edu/tictactoe/App$1.class new file mode 100644 index 0000000..0c8c36b Binary files /dev/null and b/lib/build/classes/java/main/edu/tictactoe/App$1.class differ diff --git a/lib/build/classes/java/main/edu/tictactoe/App.class b/lib/build/classes/java/main/edu/tictactoe/App.class new file mode 100644 index 0000000..bc2d32b Binary files /dev/null and b/lib/build/classes/java/main/edu/tictactoe/App.class differ diff --git a/lib/build/classes/java/main/edu/tictactoe/Board.class b/lib/build/classes/java/main/edu/tictactoe/Board.class new file mode 100644 index 0000000..2b36efa Binary files /dev/null and b/lib/build/classes/java/main/edu/tictactoe/Board.class differ diff --git a/lib/build/classes/java/main/edu/tictactoe/BoardButton.class b/lib/build/classes/java/main/edu/tictactoe/BoardButton.class new file mode 100644 index 0000000..2b2072b Binary files /dev/null and b/lib/build/classes/java/main/edu/tictactoe/BoardButton.class differ diff --git a/lib/build/classes/java/main/edu/tictactoe/ResourceImageLoader.class b/lib/build/classes/java/main/edu/tictactoe/ResourceImageLoader.class new file mode 100644 index 0000000..535290d Binary files /dev/null and b/lib/build/classes/java/main/edu/tictactoe/ResourceImageLoader.class differ diff --git a/lib/build/classes/java/main/edu/tictactoe/SystemPlayTask.class b/lib/build/classes/java/main/edu/tictactoe/SystemPlayTask.class new file mode 100644 index 0000000..71e92da Binary files /dev/null and b/lib/build/classes/java/main/edu/tictactoe/SystemPlayTask.class differ diff --git a/lib/build/distributions/lib-1.0.tar b/lib/build/distributions/lib-1.0.tar new file mode 100644 index 0000000..37154e1 Binary files /dev/null and b/lib/build/distributions/lib-1.0.tar differ diff --git a/lib/build/distributions/lib-1.0.zip b/lib/build/distributions/lib-1.0.zip new file mode 100644 index 0000000..d584419 Binary files /dev/null and b/lib/build/distributions/lib-1.0.zip differ diff --git a/lib/build/libs/lib-1.0.jar b/lib/build/libs/lib-1.0.jar new file mode 100644 index 0000000..6c4a287 Binary files /dev/null and b/lib/build/libs/lib-1.0.jar differ diff --git a/lib/build/resources/main/blank.png b/lib/build/resources/main/blank.png new file mode 100644 index 0000000..2112b71 Binary files /dev/null and b/lib/build/resources/main/blank.png differ diff --git a/lib/build/resources/main/naught.png b/lib/build/resources/main/naught.png new file mode 100644 index 0000000..d7da89f Binary files /dev/null and b/lib/build/resources/main/naught.png differ diff --git a/lib/build/resources/main/x.png b/lib/build/resources/main/x.png new file mode 100644 index 0000000..e8243ff Binary files /dev/null and b/lib/build/resources/main/x.png differ diff --git a/lib/build/resources/naught.png b/lib/build/resources/naught.png new file mode 100644 index 0000000..d7da89f Binary files /dev/null and b/lib/build/resources/naught.png differ diff --git a/lib/build/resources/x.png b/lib/build/resources/x.png new file mode 100644 index 0000000..e8243ff Binary files /dev/null and b/lib/build/resources/x.png differ diff --git a/lib/build/scripts/lib b/lib/build/scripts/lib new file mode 100755 index 0000000..88d3ff1 --- /dev/null +++ b/lib/build/scripts/lib @@ -0,0 +1,250 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# lib start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh lib +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and LIB_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}.." > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/lib/lib-1.0.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and LIB_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and LIB_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + -classpath "$CLASSPATH" \ + edu.tictactoe.App \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $LIB_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/lib/build/scripts/lib.bat b/lib/build/scripts/lib.bat new file mode 100644 index 0000000..654a355 --- /dev/null +++ b/lib/build/scripts/lib.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem lib startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME%.. + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and LIB_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\lib\lib-1.0.jar + + +@rem Execute lib +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %LIB_OPTS% -classpath "%CLASSPATH%" edu.tictactoe.App %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable LIB_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%LIB_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lib/build/tmp/compileJava/compileTransaction/stash-dir/App$1.class.uniqueId2 b/lib/build/tmp/compileJava/compileTransaction/stash-dir/App$1.class.uniqueId2 new file mode 100644 index 0000000..0c8c36b Binary files /dev/null and b/lib/build/tmp/compileJava/compileTransaction/stash-dir/App$1.class.uniqueId2 differ diff --git a/lib/build/tmp/compileJava/compileTransaction/stash-dir/App.class.uniqueId0 b/lib/build/tmp/compileJava/compileTransaction/stash-dir/App.class.uniqueId0 new file mode 100644 index 0000000..bc2d32b Binary files /dev/null and b/lib/build/tmp/compileJava/compileTransaction/stash-dir/App.class.uniqueId0 differ diff --git a/lib/build/tmp/compileJava/compileTransaction/stash-dir/Board.class.uniqueId3 b/lib/build/tmp/compileJava/compileTransaction/stash-dir/Board.class.uniqueId3 new file mode 100644 index 0000000..2b36efa Binary files /dev/null and b/lib/build/tmp/compileJava/compileTransaction/stash-dir/Board.class.uniqueId3 differ diff --git a/lib/build/tmp/compileJava/compileTransaction/stash-dir/BoardButton.class.uniqueId4 b/lib/build/tmp/compileJava/compileTransaction/stash-dir/BoardButton.class.uniqueId4 new file mode 100644 index 0000000..2b2072b Binary files /dev/null and b/lib/build/tmp/compileJava/compileTransaction/stash-dir/BoardButton.class.uniqueId4 differ diff --git a/lib/build/tmp/compileJava/compileTransaction/stash-dir/SystemPlayTask.class.uniqueId1 b/lib/build/tmp/compileJava/compileTransaction/stash-dir/SystemPlayTask.class.uniqueId1 new file mode 100644 index 0000000..7fa73c1 Binary files /dev/null and b/lib/build/tmp/compileJava/compileTransaction/stash-dir/SystemPlayTask.class.uniqueId1 differ diff --git a/lib/build/tmp/compileJava/previous-compilation-data.bin b/lib/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..6e73aba Binary files /dev/null and b/lib/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/lib/build/tmp/jar/MANIFEST.MF b/lib/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..8edcde5 --- /dev/null +++ b/lib/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Main-Class: edu.tictactoe.App +Implementation-Title: edu.tictactoe.App +Implementation-Version: 1.0 +Class-Path: edu.tictactoe . + diff --git a/lib/src/main/java/edu/tictactoe/App.java b/lib/src/main/java/edu/tictactoe/App.java new file mode 100644 index 0000000..e94deea --- /dev/null +++ b/lib/src/main/java/edu/tictactoe/App.java @@ -0,0 +1,54 @@ +package edu.tictactoe; + +import java.awt.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; + +import javax.swing.ImageIcon; + +public final class App { + // main function + public static void main(String[] args) throws Exception { + { + EventQueue.invokeLater(() -> { + // 1. Create the Frame + Frame frame = new Frame("TicTacToe"); + + // 2. Set the layout manager to GridLayout (3 rows, 2 columns) + frame.setLayout(new GridLayout(3, 3)); + frame.setEnabled(false); + Board board = new Board(frame); + BufferedImage blankImage = BoardButton.getBlankImage(); + + frame.add(new BoardButton("0", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("1", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("2", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("3", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("4", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("5", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("6", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("7", new ImageIcon(blankImage), board)); + frame.add(new BoardButton("8", new ImageIcon(blankImage), board)); + + // 4. Set frame properties + frame.setSize(480, 480); // Set an initial size + frame.pack(); + frame.setResizable(false); + frame.setLocationRelativeTo(null); // Center + frame.setEnabled(true); + frame.setVisible(true); // Make the frame visible + + + // 5. Add a window listener to handle the close button + frame.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + }); + + } + } +} \ No newline at end of file diff --git a/lib/src/main/java/edu/tictactoe/Board.java b/lib/src/main/java/edu/tictactoe/Board.java new file mode 100644 index 0000000..a67a789 --- /dev/null +++ b/lib/src/main/java/edu/tictactoe/Board.java @@ -0,0 +1,50 @@ +package edu.tictactoe; + +import java.util.Random; +import java.util.Timer; +import java.util.TimerTask; + +import java.awt.Frame; + +public final class Board { + final int User = 1; + final int System = 0; + final Timer timer = new Timer(); + + Frame frame = null; + + public Board(Frame frame) { + this.frame = frame; + } + + public static int getRandomPlay() { + Random random = new Random(); + // Generate a random integer from 0 to 8. + return random.nextInt(9); + } + + protected void setEnabledUIContainer(boolean enabled) { + this.frame.setEnabled(enabled); + } + + void PlayEventUpdate() { + long delay = 1800; + frame.setEnabled(false); + timer.schedule(new SystemPlayTask(this), delay); + } +} + +class SystemPlayTask extends TimerTask { + final Board board; + + SystemPlayTask(Board board) { + super(); + this.board = board; + } + + @Override + public void run() { + System.out.println("Task executed at: " + new java.util.Date()); + board.setEnabledUIContainer(true); + } +} diff --git a/lib/src/main/java/edu/tictactoe/BoardButton.java b/lib/src/main/java/edu/tictactoe/BoardButton.java new file mode 100644 index 0000000..7a344be --- /dev/null +++ b/lib/src/main/java/edu/tictactoe/BoardButton.java @@ -0,0 +1,44 @@ +package edu.tictactoe; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; + +import javax.swing.ImageIcon; +import javax.swing.JButton; + +public class BoardButton extends JButton implements ActionListener { + + // Board + private static final BufferedImage xImage = ResourceImageLoader.loadImageFromResource("/x.png"); + private static final BufferedImage naughtImage = ResourceImageLoader.loadImageFromResource("/naught.png"); + private static final BufferedImage blankImage = ResourceImageLoader.loadImageFromResource("/blank.png"); + + final Board board; + + public BoardButton(String label, ImageIcon imageIcon, Board board) { + super(label, imageIcon); + this.board = board; + this.setMargin(new java.awt.Insets(0, 0, 0, 0)); + this.addActionListener(this); + } + + public static final BufferedImage getXImage() { + return xImage; + } + + public static final BufferedImage getNaughtImage() { + return naughtImage; + } + + public static final BufferedImage getBlankImage() { + return blankImage; + } + + @Override + public void actionPerformed(ActionEvent e) { + this.setIcon(new ImageIcon(xImage)); + + board.PlayEventUpdate(); + } +} diff --git a/lib/src/main/java/edu/tictactoe/ResourceImageLoader.java b/lib/src/main/java/edu/tictactoe/ResourceImageLoader.java new file mode 100644 index 0000000..d6d6993 --- /dev/null +++ b/lib/src/main/java/edu/tictactoe/ResourceImageLoader.java @@ -0,0 +1,22 @@ +package edu.tictactoe; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; + +public final class ResourceImageLoader { + public static BufferedImage loadImageFromResource(String resourcePath) { + try (InputStream is = ResourceImageLoader.class.getResourceAsStream(resourcePath)) { + if (is == null) { + System.err.println( + "Resource not found: at " + ResourceImageLoader.class.getResource("/") + " - " + resourcePath); + return null; + } + return ImageIO.read(is); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } +} \ No newline at end of file diff --git a/lib/src/main/resources/blank.png b/lib/src/main/resources/blank.png new file mode 100644 index 0000000..2112b71 Binary files /dev/null and b/lib/src/main/resources/blank.png differ diff --git a/lib/src/main/resources/naught.png b/lib/src/main/resources/naught.png new file mode 100644 index 0000000..d7da89f Binary files /dev/null and b/lib/src/main/resources/naught.png differ diff --git a/lib/src/main/resources/x.png b/lib/src/main/resources/x.png new file mode 100644 index 0000000..e8243ff Binary files /dev/null and b/lib/src/main/resources/x.png differ diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..7b3843e --- /dev/null +++ b/readme.txt @@ -0,0 +1,12 @@ +Tic-Tac-Toe is a two-player game played on a 3X3 grid +where players alternate placing 'X' or 'O' in an empty +space in the grid. The first player to lineup three marks +in a row, column, or diagonal wins. X goes first, +players alternate turns, and only one player can have +a winning line (or no one). If a player has won, the game +ends immediately, and no more moves can be made. + +considering players + 3x3 = 9 + X has 5 moves. + O has 4 moves. diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..049cfff --- /dev/null +++ b/settings.gradle @@ -0,0 +1,15 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * The settings file is used to specify which projects to include in your build. + * For more detailed information on multi-project builds, please refer to https://docs.gradle.org/9.0.0/userguide/multi_project_builds.html in the Gradle documentation. + * This project uses @Incubating APIs which are subject to change. + */ + +plugins { + // Apply the foojay-resolver plugin to allow automatic download of JDKs + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' +} + +rootProject.name = 'tictactoe' +include('lib')