From 8f722fde7222d5a664753723b6fbc8bc69dadb06 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 10 Jun 2023 19:30:33 -0700 Subject: [PATCH] Use flip --- lib/chessh/ssh/client/game/renderer.ex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/chessh/ssh/client/game/renderer.ex b/lib/chessh/ssh/client/game/renderer.ex index ecd1803..676c7bd 100644 --- a/lib/chessh/ssh/client/game/renderer.ex +++ b/lib/chessh/ssh/client/game/renderer.ex @@ -178,9 +178,7 @@ defmodule Chessh.SSH.Client.Game.Renderer do curr_x = div(col, tile_width) col_relative_to_tile = col - curr_x * tile_width - board_coord = - {if(!flipped, do: curr_y, else: @chess_board_height - curr_y - 1), - if(!flipped, do: curr_x, else: @chess_board_width - curr_x - 1)} + board_coord = if flipped, do: flip({curr_y, curr_x}), else: {curr_y, curr_x} {color, char} = case Map.fetch(board_coord_to_piece_art, board_coord) do