Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
java-e003-generala
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Baez
java-e003-generala
Commits
17163760
Commit
17163760
authored
Apr 23, 2022
by
Josebaezx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final Generala V1.0
parent
a4c046c3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
24 deletions
+38
-24
.idea/misc.xml
+2
-1
.idea/runConfigurations.xml
+11
-0
out/production/java-e003-generala.git/Dado.class
+0
-0
out/production/java-e003-generala.git/Generala.class
+0
-0
out/production/java-e003-generala.git/Play.class
+0
-0
src/Dado.java
+20
-13
src/Generala.java
+5
-10
No files found.
.idea/misc.xml
View file @
17163760
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
7"
default=
"true
"
project-jdk-name=
"17"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
6
"
project-jdk-name=
"17"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/out"
/>
<output
url=
"file://$PROJECT_DIR$/out"
/>
</component>
</component>
</project>
</project>
\ No newline at end of file
.idea/runConfigurations.xml
0 → 100644
View file @
17163760
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RunConfigurationProducerService"
>
<option
name=
"ignoredProducers"
>
<set>
<option
value=
"com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer"
/>
</set>
</option>
</component>
</project>
\ No newline at end of file
out/production/java-e003-generala.git/Dado.class
View file @
17163760
No preview for this file type
out/production/java-e003-generala.git/Generala.class
View file @
17163760
No preview for this file type
out/production/java-e003-generala.git/Play.class
View file @
17163760
No preview for this file type
src/Dado.java
View file @
17163760
public
class
Dado
{
public
class
Dado
{
String
jugada
(
String
dados
)
{
String
jugada
(
String
dados
)
{
int
numeros
=
Integer
.
parseInt
(
dados
);
int
numeros
=
Integer
.
parseInt
(
dados
);
for
(
int
i
=
1
;
i
<
6
;
i
++){
if
(
numeros
>
11110
&&
numeros
<
66667
)
{
for
(
int
i
=
1
;
i
<
7
;
i
++){
String
valor
=
String
.
valueOf
((
11111
*
i
));
String
valor
=
String
.
valueOf
((
11111
*
i
));
if
(
valor
.
equals
(
dados
))
{
if
(
valor
.
equals
(
dados
))
{
return
"GENERALA"
;
return
"GENERALA"
;
...
@@ -12,26 +13,32 @@ public class Dado {
...
@@ -12,26 +13,32 @@ public class Dado {
for
(
int
i
=
1
;
i
<
7
;
i
++){
for
(
int
i
=
1
;
i
<
7
;
i
++){
String
valor
=
String
.
valueOf
((
1111
*
i
));
String
valor
=
String
.
valueOf
((
1111
*
i
));
for
(
int
j
=
1
;
j
<
7
;
j
++){
for
(
int
j
=
1
;
j
<
7
;
j
++){
String
valorx
=
valor
+
j
;
String
valor2
=
valor
+
j
;
if
(
valorx
.
equals
(
dados
))
{
if
(
valor2
.
equals
(
dados
))
{
return
"PÓKER"
;
return
"PÓKER"
;
}
}
}
}
}
}
// for (int i=1; i<6; i++){
for
(
int
i
=
1
;
i
<
7
;
i
++){
// if (numeros %i==0) {
String
valor
=
String
.
valueOf
((
111
*
i
));
// return "FULL";
for
(
int
j
=
1
;
j
<
7
;
j
++){
// }
String
valor2
=
valor
+
(
11
*
j
);
// }
if
(
valor2
.
equals
(
dados
))
{
return
"FULL"
;
}
}
}
for
(
int
i
=
15
;
i
<
21
;
i
++){
if
(
dados
.
equals
(
"12345"
)
||
dados
.
equals
(
"23456"
)
||
dados
.
equals
(
"34561"
)
if
(
numeros
%
i
==
0
)
{
||
dados
.
equals
(
"45612"
)
||
dados
.
equals
(
"56123"
)
||
dados
.
equals
(
"61234"
)
)
{
return
"ESCALERA"
;
return
"ESCALERA"
;
}
}
}
return
"NADA"
;
return
"NADA"
;
}
}
else
{
return
"INVALIDO"
;
}
}
}
}
src/Generala.java
View file @
17163760
...
@@ -8,11 +8,9 @@ public class Generala {
...
@@ -8,11 +8,9 @@ public class Generala {
// TAMBIÉN PUEDEN AGREGAR OTRAS FUNCIONES y/o CLASES
// TAMBIÉN PUEDEN AGREGAR OTRAS FUNCIONES y/o CLASES
// QUE NECESITEN PARA RESOLVER EL EJERCICIO DE LA
// QUE NECESITEN PARA RESOLVER EL EJERCICIO DE LA
// MANERA MÁS ORDENADA POSIBLE
// MANERA MÁS ORDENADA POSIBLE
Dado
d
=
new
Dado
();
String
jugada
(
String
dados
)
{
String
jugada
(
String
dados
)
{
if
(
dados
.
equals
(
"11111"
))
{
return
d
.
jugada
(
dados
);
return
"GENERALA"
;
}
return
"NADA"
;
}
}
// Ustedes pueden ignorar esto
// Ustedes pueden ignorar esto
String
[]
jugadas
(
String
[]
losdados
)
{
String
[]
jugadas
(
String
[]
losdados
)
{
...
@@ -38,7 +36,6 @@ public class Generala {
...
@@ -38,7 +36,6 @@ public class Generala {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Generala
g
=
new
Generala
();
Generala
g
=
new
Generala
();
Play
p
=
new
Play
();
Play
p
=
new
Play
();
Dado
d
=
new
Dado
();
/* IGNORAR PORQUE ESTO NO SE VA A EJECUTAR PARA USTEDES */
/* IGNORAR PORQUE ESTO NO SE VA A EJECUTAR PARA USTEDES */
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
@@ -51,10 +48,8 @@ public class Generala {
...
@@ -51,10 +48,8 @@ public class Generala {
}
}
// ESTO SI SE EJECUTA PARA USTEDES
// ESTO SI SE EJECUTA PARA USTEDES
System
.
out
.
println
(
g
.
jugada
(
"11111"
));
String
resultado
=
p
.
lanzarDados
();
System
.
out
.
println
(
"Dados lanzados = "
+
resultado
);
//String resultado = p.lanzarDados();
System
.
out
.
println
(
"Resultado: "
+
g
.
jugada
(
"66667"
));
//System.out.println("resultado = " + resultado);
System
.
out
.
println
(
d
.
jugada
(
"66665"
));
}
}
}
}
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