Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[둘리] 3, 4단계 오목 제출합니다. #34

Merged
merged 55 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f4e19dd
rebase: step2
woowahan-pjs Mar 13, 2023
1fea9a1
feat: set up the android project
woowahan-pjs Mar 14, 2023
ea810cb
feat: domain 이동
hyemdooly Mar 22, 2023
b8e4a8c
feat: add main activity and resources
woowahan-pjs Mar 21, 2023
9d5a9ea
refactor(Omok, Controller): run 함수 삭제 및 컨트롤러로 이동
hyemdooly Mar 22, 2023
2aeb6a6
feat(activity_main): TextView 추가
hyemdooly Mar 22, 2023
bfe2f72
feat(GameEventListener): GameEventListener 구현
hyemdooly Mar 22, 2023
2fce9c1
refactor(Omok): 필요없는 주석 삭제
hyemdooly Mar 22, 2023
d9b8b7c
feat(Listener): 이벤트 리스너 구현 및 strings.xml에 string 정의
hyemdooly Mar 22, 2023
3bf95f6
feat(MainActivity): MainActivity 구현
hyemdooly Mar 22, 2023
3663712
refactor(Activity, Listener): 패키지 이동
hyemdooly Mar 22, 2023
00b6655
refactor(Omok): endGame 함수 수정
hyemdooly Mar 22, 2023
bbc9fdd
refactor(OmokTest): OmokTest 테스트 재구현
hyemdooly Mar 22, 2023
dba7e4f
refactor(InputView, OutputView): InputView OutputView 인터페이스 삭제
hyemdooly Mar 23, 2023
51d920c
refactor(TurnResult): TurnResult 생성, 점진적인 리팩터링
hyemdooly Mar 23, 2023
bcfeedb
refactor(MainActivity, PlayersTest): 필요없는 테스트 삭제, 도메인 변경에 따른 MainActi…
hyemdooly Mar 23, 2023
15a1a7b
refactor(Players, Omok, Controller): Players 위치 Omok 안으로 변경, 안드로이드 Tu…
hyemdooly Mar 23, 2023
ebbbff4
refactor(MainActivity, GameEventListener): 버그 수정
hyemdooly Mar 23, 2023
116de7b
refactor(OmokTest, PlayersTest): 리팩터링에 따른 테스트 수정
hyemdooly Mar 23, 2023
7308130
feat(MainActivity, Omok, OmokConstract, OmokDBHelper, Players): 데이터베이…
hyemdooly Mar 24, 2023
8776916
refactor(gitignore): gitignore 추가
hyemdooly Mar 24, 2023
a11e464
feat(DBManager): DB로부터 원하는 정보를 뽑아주는 DBManager 생성
hyemdooly Mar 24, 2023
ff54862
refactor(MainActivity): 메인 액티비티 리팩터링
hyemdooly Mar 24, 2023
9c68fba
refactor(OmokDBManager): 필요없는 코드 삭제
hyemdooly Mar 24, 2023
0bde83d
refactor(xml): 오목판 커스텀
hyemdooly Mar 24, 2023
66200e5
refactor(MainActivity): 오목판 세팅 함수 분리
hyemdooly Mar 24, 2023
8bedfaa
refactor(MainActivity): 필요없는 코드 삭제
hyemdooly Mar 24, 2023
c753b65
fix(WhitePlayerTest): 테스트 코드 수정
hyemdooly Mar 24, 2023
5b456b2
Merge branch 'hyemdooly' into step4
hyemdooly Mar 24, 2023
4508479
refactor(xml): 필요없는 파일 삭제
hyemdooly Mar 26, 2023
b0a5e0f
refactor(Players, Player): 놓은 돌의 개수를 반환하는 함수 작성
hyemdooly Mar 26, 2023
31d1f8a
refactor(PlayerState): points 변수 protected 삭제
hyemdooly Mar 26, 2023
774c598
refactor(PlayerState): points 변수 protected 복구, getAllPoints 깊은 복사
hyemdooly Mar 26, 2023
a52748f
refactor(Black,WhitePlayerTest): 필요없는 정보 숨기기
hyemdooly Mar 26, 2023
e760a35
refactor(Points): Point List 깊은 복사
hyemdooly Mar 26, 2023
1c6b39f
refactor(PlayersTest): 테스트 코드 수정
hyemdooly Mar 26, 2023
3c0c212
refactor(MainActivity): 코드 다이어트 및 by lazy 적용
hyemdooly Mar 26, 2023
e8a7478
refactor(all): ktlintFormatting
hyemdooly Mar 26, 2023
bc554db
refactor(Players): latestPlayer 불변으로 변경
hyemdooly Mar 26, 2023
9d15441
refactor(Players, WhitePlayer, BlackPlayer): stone -> point로 명칭 변경, 최…
hyemdooly Mar 26, 2023
2d9db1e
refactor(OmokGameEventListener): InputView의 인터페이스 삭제, GameEventListen…
hyemdooly Mar 26, 2023
19e46b5
fix(BlackPlayer, WhitePlayer): 오류 수정
hyemdooly Mar 26, 2023
2aab2ac
refactor(TurnResult): 턴의 결과를 모두 포함하도록 수정
hyemdooly Mar 26, 2023
160abef
refactor(Omok): 필요없는 함수 삭제
hyemdooly Mar 26, 2023
355405a
refactor(MainActivity, TurnEventListener): 도메인 변경에 따른 코드 변경
hyemdooly Mar 26, 2023
e602dd4
refactor(Players, MainActivity): 필요없는 코드 삭제, 변수 네이밍 변경
hyemdooly Mar 26, 2023
3178d22
refactor(MainActivity, Controller, DBHelper, OutputView): 리스너, DB매니저 …
hyemdooly Mar 27, 2023
ccb0c20
refactor(ktlintFormat): ktlintformatting
hyemdooly Mar 27, 2023
b0e1fa1
refactor(DBHelper): db를 변수로 가지도록 변경
hyemdooly Mar 27, 2023
fd3b14b
refactor(Players): Players 팩토리 함수 생성
hyemdooly Mar 28, 2023
6d1ac8b
refactor(MainActivity): applicationContext -> this 변경
hyemdooly Mar 28, 2023
343d2fe
refactor(MainActivity): 많은 if문 when문 사용하여 정리
hyemdooly Mar 28, 2023
14ad02c
refactor(PlayersTest): 팩토리 함수 구현으로 인한 변경
hyemdooly Mar 28, 2023
d347785
refactor(OmokDBHelper): 오목 도메인을 가질 수 있도록 수정
hyemdooly Mar 28, 2023
98d9be3
refactor(MainActivity): onCreate에서 onClickListener 내용 분리
hyemdooly Mar 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rebase: step2
  • Loading branch information
woowahan-pjs authored and hyemdooly committed Mar 24, 2023
commit f4e19ddafe1ae0f277832b488efa0ca679a21e1e
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**
!**/src/test/**

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
32 changes: 32 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
kotlin("jvm") version "1.8.10"
id("org.jlleitschuh.gradle.ktlint") version "10.3.0"
}

group = "camp.nextstep.edu"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
}

dependencies {
testImplementation("org.junit.jupiter", "junit-jupiter", "5.8.2")
testImplementation("org.assertj", "assertj-core", "3.22.0")
testImplementation("io.kotest", "kotest-runner-junit5", "5.2.3")
}

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
}
test {
useJUnitPlatform()
}
ktlint {
verbose.set(true)
}
}
27 changes: 27 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 오목

### Domain
- [x] 한 플레이어라도 승리할 때까지 차례를 번갈아가면서 돌을 놓는다.
- [x] 흑, 백 플레이어를 가지고 있다
- [x] 흑돌이 먼저 시작한다.
- [x] 게임의 진행 여부는 `PlayerState`가 결정한다.
- [x] 오목알은 자신의 위치를 알고 있다.
- [x] `x, y` 위치는 `1부터 15`로 제한된다.
- [x] 중복되는 위치의 오목알을 가질 수 없다.
- [x] 오목판의 크기는 `15 x 15`이다.
- [x] 사용자는 오목알을 놓는다.
- [x] 오목알을 놓았을 때 5개 이상 연이어 있으면 승리한다.
- [x] 오목알을 놓았을 때 5개 미만 연이어 있으면 게임을 계속 진행한다.
- [x] 특정 위치에 돌을 놓을 수 있는지 판단한다.
- [x] 플레이어는 흑과 백으로 이루어져 있다.
- [x] 오목알을 놓은 플레이어가 게임에서 이겼는지 확인한다.
- [x] 사용자는 특정 위치에 내 돌이 있는지 확인한다.
- [x] 사용자는 마지막 돌의 위치를 알고 있다.
- [x] 오목알을 놓으면 상대방의 차례가 된다.

### Input
- [x] 오목알을 놓을 위치를 입력받는다.

### Output
- [x] 오목알의 위치를 입력받기 전에 오목판을 출력한다.
- [x] 마지막 돌의 위치를 출력한다.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
244 changes: 244 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
#!/bin/sh

#
# Copyright © 2015-2021 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.
#

##############################################################################
#
# 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/subprojects/plugins/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##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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"'

# 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/gradle/wrapper/gradle-wrapper.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
which java >/dev/null 2>&1 || 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

# 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=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=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

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# 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" "$@"
Loading