started with the TicTacToe_MinMax Project. Finished the rendering of the game.
TODO: Make a playable version and add MinMax
This commit is contained in:
19
CodingChallanges/src/geometry/PentagonalNumber.java
Normal file
19
CodingChallanges/src/geometry/PentagonalNumber.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package geometry;
|
||||
|
||||
public class PentagonalNumber {
|
||||
|
||||
//Edabit-Challange
|
||||
//https://edabit.com/challenge/H6eTNH6NW36MHqkjb
|
||||
|
||||
public static int pentagonal(int num) {
|
||||
int outerRings = 0;
|
||||
for(int i = num-1; i > 0; i--){
|
||||
outerRings += i * 5;
|
||||
}
|
||||
return outerRings + 1;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(pentagonal(10));
|
||||
}
|
||||
}
|
||||
26
CodingChallanges/src/geometry/makeGrid.java
Normal file
26
CodingChallanges/src/geometry/makeGrid.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package geometry;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class makeGrid {
|
||||
|
||||
//Edabit-Challange
|
||||
//https://edabit.com/challenge/7Tb7qMDQHtz3xpydd
|
||||
|
||||
public static int[][] squarePatch( int n ){
|
||||
int[][] array = new int[n][n];
|
||||
int i = 0;
|
||||
while (i < n){
|
||||
for (int j = 0; j < n; j++){
|
||||
array[i][j] = n;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Arrays.toString(squarePatch(4)));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user