Repository: thomas-mauran/chess-tui (language: rust)

Issue:
fix(historic): line 8 is translated to 0 
## Description

When moving a piece from the 8th row (black first one) the historic indicates a 0 instead of an 8.

## To Reproduce

- move a piece from the 8th row and check the historic

## Expected behavior

display 8 instead of 0

## Screenshots

![image](https://github.com/thomas-mauran/chess-tui/assets/78204354/8c8524c1-7c20-410e-9688-b65415468248)


Discussion / hints:

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 9a4ec28..e755b14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "chess-tui"
-version = "1.0.0"
+version = "1.0.1"
 authors = ["Thomas Mauran"]
 license = "MIT"
 edition = "2021"
diff --git a/src/utils.rs b/src/utils.rs
index cd9ad82..52a8c2a 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -115,10 +115,10 @@ pub fn convert_position_into_notation(position: String) -> String {
     let to_x = get_int_from_char(position.chars().nth(3));
 
     result += &col_to_letter(from_x);
-    result += &format!("{}", (8 - from_y) % 8).to_string();
+    result += &format!("{}", (8 - from_y) % 9).to_string();
     result += "-";
     result += &col_to_letter(to_x);
-    result += &format!("{}", (8 - to_y) % 8).to_string();
+    result += &format!("{}", (8 - to_y) % 9).to_string();
 
     result
 }
@@ -250,3 +250,18 @@ pub fn color_to_ratatui_enum(piece_color: Option<PieceColor>) -> Color {
         None => Color::Red,
     }
 }
+
+#[cfg(test)]
+mod tests {
+    use crate::utils::convert_position_into_notation;
+
+    #[test]
+    fn convert_position_into_notation_1() {
+        assert_eq!(convert_position_into_notation("7152".to_string()), "b1-c3")
+    }
+
+    #[test]
+    fn convert_position_into_notation_2() {
+        assert_eq!(convert_position_into_notation("0257".to_string()), "c8-h3")
+    }
+}


Test patch: