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
e9d5dbb0
Commit
e9d5dbb0
authored
Apr 25, 2022
by
Yovan Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregado el metodo ordenarCadena
parent
58496db5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
Carta.java
+13
-3
No files found.
Carta.java
View file @
e9d5dbb0
...
@@ -30,7 +30,16 @@ public class Carta {
...
@@ -30,7 +30,16 @@ public class Carta {
public
void
armarValores
(
String
valores
){
public
void
armarValores
(
String
valores
){
valor
=
valor
+
String
.
valueOf
(
valores
.
charAt
(
0
));
valor
=
valor
+
String
.
valueOf
(
valores
.
charAt
(
0
));
}
}
//Recibe un string y lo ordena segun orden numerico o alfabetico
public
String
ordenarCadena
(
String
original
){
String
numeroAOrdenar
=
original
;
numeroAOrdenar
=
original
;
char
[]
chars
=
numeroAOrdenar
.
toCharArray
();
Arrays
.
sort
(
chars
);
String
cadenaOrdenada
=
new
String
(
chars
);
return
cadenaOrdenada
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
Carta
partida
=
new
Carta
();
Carta
partida
=
new
Carta
();
String
[]
Mano
=
new
String
[]{
"5H"
,
"4C"
,
"AS"
,
"3S"
,
"2D"
,};
String
[]
Mano
=
new
String
[]{
"5H"
,
"4C"
,
"AS"
,
"3S"
,
"2D"
,};
...
@@ -40,9 +49,10 @@ public class Carta {
...
@@ -40,9 +49,10 @@ public class Carta {
partida
.
armarPalos
(
Mano
[
i
]);
partida
.
armarPalos
(
Mano
[
i
]);
partida
.
armarValores
(
Mano
[
i
]);
partida
.
armarValores
(
Mano
[
i
]);
}
}
System
.
out
.
println
(
"Aca tenes che kp: "
+
partida
.
palo
);
System
.
out
.
println
(
"Aca tenes desordenado che kp: "
+
partida
.
palo
);
System
.
out
.
println
(
"Aca tenes che kp: "
+
partida
.
valor
);
System
.
out
.
println
(
"Aca tenes desordenado che kp: "
+
partida
.
valor
);
System
.
out
.
println
(
"Aca tenes ordenado che kp: "
+
partida
.
palo
);
System
.
out
.
println
(
"Aca tenes ordenado 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