Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Pentago
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9628055
Pentago
Commits
bd314920
Commit
bd314920
authored
Apr 07, 2020
by
nargessalehi98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one class
parents
Pipeline
#3343
failed with stages
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
0 deletions
+109
-0
Pentago.u.iml
Pentago.u.iml
+12
-0
Main.class
out/production/Pentago.u/Main.class
+0
-0
Map.class
out/production/Pentago.u/Map.class
+0
-0
Main.java
src/Main.java
+97
-0
Map.java
src/Map.java
+0
-0
No files found.
Pentago.u.iml
0 → 100644
View file @
bd314920
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src"
isTestSource=
"false"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
out/production/Pentago.u/Main.class
0 → 100644
View file @
bd314920
File added
out/production/Pentago.u/Map.class
0 → 100644
View file @
bd314920
File added
src/Main.java
0 → 100644
View file @
bd314920
import
java.util.Random
;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
Random
random
=
new
Random
();
int
rand
=
random
.
nextInt
(
2
);
String
red
=
" 🔴 "
;
String
black
=
" ⚫ "
;
Map
map
=
new
Map
();
map
.
print
();
if
(
rand
==
0
)
{
while
(
true
)
{
map
.
putDisk
(
red
);
map
.
print
();
if
(
map
.
checkWinner
(
red
))
{
System
.
out
.
println
(
"\nRed is winner !"
);
break
;
}
map
.
rotate
();
map
.
print
();
if
(
map
.
checkWinner
(
red
)
&&
map
.
checkWinner
(
black
))
{
System
.
out
.
println
(
"\nequal!"
);
break
;
}
else
if
(
map
.
checkWinner
(
red
)){
System
.
out
.
println
(
"\nRed is winner !"
);
break
;
}
else
if
(
map
.
checkWinner
(
black
)){
System
.
out
.
println
(
"\nblack is winner !"
);
break
;
}
map
.
putDisk
(
black
);
map
.
print
();
if
(
map
.
checkWinner
(
black
))
{
System
.
out
.
println
(
"\nblack is winner !"
);
break
;
}
map
.
rotate
();
map
.
print
();
if
(
map
.
checkWinner
(
red
)
&&
map
.
checkWinner
(
black
))
{
System
.
out
.
println
(
"\nequal!"
);
break
;
}
else
if
(
map
.
checkWinner
(
red
)){
System
.
out
.
println
(
"\nRed is winner !"
);
break
;
}
else
if
(
map
.
checkWinner
(
black
)){
System
.
out
.
println
(
"\nblack is winner !"
);
break
;
}
}
}
else
{
while
(
true
)
{
map
.
putDisk
(
black
);
map
.
print
();
if
(
map
.
checkWinner
(
black
))
{
System
.
out
.
println
(
"\nblack is winner !"
);
break
;
}
map
.
rotate
();
map
.
print
();
if
(
map
.
checkWinner
(
red
)
&&
map
.
checkWinner
(
black
))
{
System
.
out
.
println
(
"\nequal!"
);
break
;
}
else
if
(
map
.
checkWinner
(
red
)){
System
.
out
.
println
(
"\nRed is winner !"
);
break
;
}
else
if
(
map
.
checkWinner
(
black
)){
System
.
out
.
println
(
"\nblack is winner !"
);
break
;
}
map
.
putDisk
(
red
);
map
.
print
();
if
(
map
.
checkWinner
(
red
))
{
System
.
out
.
println
(
"\nRed is winner !"
);
break
;
}
map
.
rotate
();
map
.
print
();
if
(
map
.
checkWinner
(
red
)
&&
map
.
checkWinner
(
black
))
{
System
.
out
.
println
(
"\nequal!"
);
break
;
}
else
if
(
map
.
checkWinner
(
red
)){
System
.
out
.
println
(
"\nRed is winner !"
);
break
;
}
else
if
(
map
.
checkWinner
(
black
)){
System
.
out
.
println
(
"\nblack is winner !"
);
break
;
}
}
}
}
}
src/Map.java
0 → 100644
View file @
bd314920
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment