Skálavariációk Xa.
Kezdő és haladó skálavariációk szétválasztása
és algoritmizálása
3 hang 3 hangmagasságon
public class Main {
public static void main(String[] args) {
int count = 0;
for (int i = 0; i <= 2; i++){
String string_i = Integer.toString(i);
for (int j = 0; j <= 2; j++){
String string_j = Integer.toString(j);
for (int k = 0; k <= 2; k++){
String string_k = Integer.toString(k);
String scaleVariaton = string_i + string_j + string_k;
if (scaleVariaton.contains("0")){
count++;
if((i > k) || scaleVariaton.contains("2")) {
System.out.println ("" + count + ". - " + i + j + k + " - haladó");
}
else
System.out.println ("" + count + ". - " + i + j + k + " - kezdő");
}
}
}
}
}
}
1. - 000 - kezdő
2. - 001 - kezdő
3. - 002 - haladó
4. - 010 - kezdő
5. - 011 - kezdő
6. - 012 - haladó
7. - 020 - haladó
8. - 021 - haladó
9. - 022 - haladó
10. - 100 - haladó
11. - 101 - kezdő
12. - 102 - haladó
13. - 110 - haladó
14. - 120 - haladó
15. - 200 - haladó
16. - 201 - haladó
17. - 202 - haladó
18. - 210 - haladó
19. - 220 - haladó
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<String> kezdo = new ArrayList<String>();
ArrayList<String> halado = new ArrayList<String>();
int countKezdo = 1;
int countHalado = 1;
for (int i = 0; i <= 2; i++){
String string_i = Integer.toString(i);
for (int j = 0; j <= 2; j++){
String string_j = Integer.toString(j);
for (int k = 0; k <= 2; k++){
String string_k = Integer.toString(k);
String scaleVariaton = string_i + string_j + string_k;
if (scaleVariaton.contains("0")){
if((i > k) || scaleVariaton.contains("2")) {
halado.add(scaleVariaton);
}
else
kezdo.add(scaleVariaton);;
}
}
}
}
System.out.println("Kezdő SV:");
for(int i = 0; i < kezdo.size(); i++) {
System.out.println(countKezdo + ". - " + kezdo.get(i) + "");
countKezdo++;
}
System.out.println();
System.out.println("Haladó SV:");
for(int i = 0; i < halado.size(); i++) {
System.out.println(countHalado + ". - " + halado.get(i) + "");
countHalado++;
}
}
}
Kezdő SV:
1. - 000
2. - 001
3. - 010
4. - 011
5. - 101
Haladó SV:
1. - 002
2. - 012
3. - 020
4. - 021
5. - 022
6. - 100
7. - 102
8. - 110
9. - 120
10. - 200
11. - 201
12. - 202
13. - 210
14. - 220