Skip to content

Commit

Permalink
update github workflow & new ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
ziloka committed Oct 21, 2023
1 parent 2cebc1b commit 708fd51
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: tetris
path: target/release/tetris.*
path: target/release/client.*
publish_release:
name: Publish release
if: ${{ !cancelled() && needs.build_tetris.result == 'success' }}
Expand All @@ -72,8 +72,8 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: tetris
path: artifacts
name: client
path: target/release
- name: Create release
id: create_release
run: |
Expand Down
19 changes: 16 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,21 @@ path = "src/bin/client.rs"

[dependencies]
macroquad = "0.4"

# PC Finder
# tetra-tools = { git = "https://github.com/wirelyre/tetra-tools" }

# Play again a AI bot, rust bot
# cold-clear-2 = { git = "https://github.com/MinusKelvin/cold-clear-2" }
# claim with faster move gen https://github.com/citrus610/cold-clear-2 (better performance)

# AI bot, c# bot
# zetris = { git = "https://github.com/mat1jaczyyy/Zetris" }
# to setup c# bot
# https://medium.com/@chyyran/calling-c-natively-from-rust-1f92c506289d, follow to setup the above repository to be able to compile c# code to native machine code
# generate c# static / shared libraries, https://learn.microsoft.com/en-us/windows/uwp/dotnet-native/getting-started-with-net-native
# https://github.com/dotnet/corert is superseded by https://github.com/dotnet/runtimelab/tree/feature/NativeAOT

# Can't use the following tetris bots
# https://github.com/jezevec10/MisaMinoBot
# https://github.com/mat1jaczyyy/Zetris
# Misa-mino, c++ bot
# misa-mino = { git = "https://github.com/jezevec10/MisaMinoBot" }
# random fork, with new comments but idk what the commits are https://github.com/iclyxcly/MisaMino
13 changes: 10 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Implement
- ~~Infinite Undo~~
- Replay
- Add Replay
- 180 rotations wallkicks
- Custom block pieces
- Fix Softdrop movement
- Implement screenshot to import grid
- Implement screenshot to import grid
- Change Soft Drop Speed and Delay
- Add Stats (CLEAR, SENT)
- Add two more additional "invisible" rows at top of board
- Different Training modes
- Be able to set tetromino bag
- Fumen compatibility
- AI tools / PC finders
- set up way for setups / openers
4 changes: 3 additions & 1 deletion notes/WALLKICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
[180 Wallkicks](https://tetris.fandom.com/wiki/SRS#180%C2%B0_rotation)
- [Nullpomino 180 wallkick table](https://github.com/nullpomino/nullpomino/blob/ca361b926cb2f52ce302c7d901b9ca693e830f9f/nullpomino-core/src/main/java/mu/nu/nullpo/game/subsystem/wallkick/StandardWallkick.java#L112-L125)

[Use SRS+](https://tetris.wiki/TETR.IO#SRS+)
[Use SRS+](https://tetris.wiki/TETR.IO#SRS+)

https://tetrisconcept.net/threads/how-to-write-a-srs-wall-kick-algorithm.133/
4 changes: 2 additions & 2 deletions scripts/wallkicks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ function generate_test_case(table, offset, init_rot_indx, dest_rot_index) {
// document.querySelector("table[style=\"text-align:center;\"]").querySelector("tr[align=\"center\"]").querySelectorAll(":nth-last-child(n+2 of td[width=\"74\"])");
// document.querySelector("table[style=\"text-align:center;\"]").querySelectorAll("tr[align=\"center\"] td:nth-child(n+7)");
// document.querySelector("table[style=\"text-align:center;\"]").querySelector("tr[align=\"center\"]").querySelectorAll("td[width=\"74\"]:nth-child(n+7)");
$("table[style=\"text-align:center;\"]").each((i, tetrominoTests) => {
$("table[style=\"text-align:center;\"]").each((_, tetrominoTests) => {
// if ([1, 3].includes(i)) return;
// console.log(`Tetromino test#${i}`);
$(tetrominoTests).find("tr[align=\"center\"]").each((j, row) => {
$(tetrominoTests).find("tr[align=\"center\"]").each((_, row) => {
// console.log(`On row #${j}`);

const [init_rot_indx, dest_rot_indx] = $(row).find("th").text().trim().split("⇒");
Expand Down
3 changes: 0 additions & 3 deletions src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ use tetris::{
},
};

const G: Option<(u8, u8, u8)> = Some((105, 105, 105));
const N: Option<(u8, u8, u8)> = None;

#[main("Tetris")]
async fn main() {
let bottom_left_corner = Cell::new(vec2(0.0, 0.0));
Expand Down
16 changes: 8 additions & 8 deletions tests/wallkicks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const G: Option<(u8, u8, u8)> = Some((0, 0, 0));
const N: Option<(u8, u8, u8)> = None;

#[test]
fn tetromino_J_90_clockwise_wallkicks() {
fn tetromino_j_90_clockwise_wallkicks() {
// 0->R (-1, 0)
generate(
vec![
Expand Down Expand Up @@ -148,7 +148,7 @@ fn tetromino_J_90_clockwise_wallkicks() {
}

#[test]
fn tetromino_L_90_clockwise_wallkicks() {
fn tetromino_l_90_clockwise_wallkicks() {
// 0->1 (-1, 0)
generate(
vec![
Expand Down Expand Up @@ -195,7 +195,7 @@ fn tetromino_L_90_clockwise_wallkicks() {
vec![N, N, N, N, N],
],
Tetromino::L,
vec![ vec2(1., 2.), vec2(1., 3.), vec2(2., 3.), vec2(1., 1.)],
vec![vec2(1., 2.), vec2(1., 3.), vec2(2., 3.), vec2(1., 1.)],
1,
vec![vec2(2., 1.), vec2(3., 1.), vec2(3., 0.), vec2(1., 1.)],
);
Expand Down Expand Up @@ -270,7 +270,7 @@ fn tetromino_L_90_clockwise_wallkicks() {
}

#[test]
fn tetromino_T_90_clockwise_wallkicks() {
fn tetromino_t_90_clockwise_wallkicks() {
// 0->1 (-1,-2)
generate(
vec![
Expand Down Expand Up @@ -409,7 +409,7 @@ fn tetromino_T_90_clockwise_wallkicks() {
}

#[test]
fn tetromino_S_90_clockwise_wallkicks() {
fn tetromino_s_90_clockwise_wallkicks() {
// 0->1 (-1,-2)
generate(
vec![
Expand Down Expand Up @@ -492,7 +492,7 @@ fn tetromino_S_90_clockwise_wallkicks() {
Tetromino::S,
vec![vec2(2., 3.), vec2(3., 3.), vec2(1., 2.), vec2(2., 2.)],
2,
vec![vec2(1., 1.), vec2(2., 1.), vec2(2., 0.), vec2(1., 2.),],
vec![vec2(1., 1.), vec2(2., 1.), vec2(2., 0.), vec2(1., 2.)],
);

// 3->0 (-1, 0)
Expand All @@ -514,7 +514,7 @@ fn tetromino_S_90_clockwise_wallkicks() {
}

#[test]
fn tetromino_Z_90_clockwise_wallkicks() {
fn tetromino_z_90_clockwise_wallkicks() {
// 0->1 ( 0,-2)
generate(
vec![
Expand Down Expand Up @@ -619,4 +619,4 @@ fn tetromino_Z_90_clockwise_wallkicks() {
}

#[test]
fn tetromino_I_90_clockwise_wallkicks() {}
fn tetromino_i_90_clockwise_wallkicks() {}

0 comments on commit 708fd51

Please sign in to comment.