Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
poker
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
Yovan Martinez
poker
Commits
58496db5
Commit
58496db5
authored
Apr 25, 2022
by
Yovan Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregados los metodos armarvalores y armarpalos ademas del gitignore
parent
3031c88a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
.gitignore
+3
-0
Carta.java
+32
-5
No files found.
.gitignore
0 → 100644
View file @
58496db5
*.class
*.txt
\ No newline at end of file
Carta.java
View file @
58496db5
import
javax.print.DocFlavor.STRING
;
import
java.util.Arrays
;
public
class
Carta
{
public
String
valor
;
public
String
palo
;
public
Carta
()
{
palo
=
""
;
valor
=
""
;
}
//Cosa que puso el profe con intenciones que desconozco
public
Carta
(
String
completo
)
{
String
suit
=
""
;
String
numbers
=
""
;
this
.
valor
=
String
.
valueOf
(
completo
.
charAt
(
0
));
this
.
palo
=
String
.
valueOf
(
completo
.
charAt
(
1
));
}
//Guarda todos los valores de palo de las cartas en un solo string para guardarlos
public
void
armarPalos
(
String
carta
){
String
palos
=
""
;
palo
=
palo
+
String
.
valueOf
(
carta
.
charAt
(
1
));
}
String
valorPalo
()
{
return
this
.
valor
+
this
.
palo
;
}
//Esto es un comentario
//Guarda todos los valores de las cartas en un solo string para trabajarlos
public
void
armarValores
(
String
valores
){
valor
=
valor
+
String
.
valueOf
(
valores
.
charAt
(
0
));
}
public
static
void
main
(
String
[]
args
)
{
Carta
partida
=
new
Carta
();
String
[]
Mano
=
new
String
[]{
"5H"
,
"4C"
,
"AS"
,
"3S"
,
"2D"
,};
String
manoCompleta
=
""
;
for
(
int
i
=
0
;
i
<
Mano
.
length
;
i
++){
partida
.
armarPalos
(
Mano
[
i
]);
partida
.
armarValores
(
Mano
[
i
]);
}
System
.
out
.
println
(
"Aca tenes che kp: "
+
partida
.
palo
);
System
.
out
.
println
(
"Aca tenes che kp: "
+
partida
.
valor
);
}
}
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