Skip to content

Commit 2e368bb

Browse files
committed
Show single dummy hands offset to the right
1 parent ec17a8a commit 2e368bb

3 files changed

Lines changed: 20 additions & 25 deletions

File tree

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
version: 1.3.1
2+
version: 1.4.0
33
title: bridgebot single dummy
44
file: ./test/bridgebot_test.gleam
55
test_name: single_dummy_test
66
---
7-
♠AKx R/R
8-
♥QTxxx MPs
9-
♦Jxx
10-
♣Tx
7+
R/R ♠AKx
8+
MPs ♥QTxxx
9+
♦Jxx
10+
♣Tx
1111

12-
♠QJxxx
13-
♥AKx
14-
♦Qx
15-
♣xxx
12+
♠QJxxx
13+
♥AKx
14+
♦Qx
15+
♣xxx

manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ packages = [
1515
{ name = "gleam_community_colour", version = "2.0.2", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib"], otp_app = "gleam_community_colour", source = "hex", outer_checksum = "E34DD2C896AC3792151EDA939DA435FF3B69922F33415ED3C4406C932FBE9634" },
1616
{ name = "gleam_crypto", version = "1.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "50774BAFFF1144E7872814C566C5D653D83A3EBF23ACC3156B757A1B6819086E" },
1717
{ name = "gleam_erlang", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "1124AD3AA21143E5AF0FC5CF3D9529F6DB8CA03E43A55711B60B6B7B3874375C" },
18-
{ name = "gleam_hackney", version = "1.3.1", build_tools = ["gleam"], requirements = ["gleam_http", "gleam_stdlib", "hackney"], otp_app = "gleam_hackney", source = "hex", outer_checksum = "0449AADBEBF3E979509A4079EE34B92EEE4162C5A0DC94F3DA2787E4777F6B45" },
18+
{ name = "gleam_hackney", version = "1.3.2", build_tools = ["gleam"], requirements = ["gleam_http", "gleam_stdlib", "hackney"], otp_app = "gleam_hackney", source = "hex", outer_checksum = "CF6B627BC3E3726D14D220C30ACE8EF32433F19C33CE96BBF70C2068DFF04ACD" },
1919
{ name = "gleam_http", version = "4.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "DD0271B32C356FB684EC7E9F48B1E835D0480168848581F68983C0CC371405D4" },
2020
{ name = "gleam_json", version = "3.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "874FA3C3BB6E22DD2BB111966BD40B3759E9094E05257899A7C08F5DE77EC049" },
2121
{ name = "gleam_otp", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "7987CBEBC8060B88F14575DEF546253F3116EBE2A5DA6FD82F38243FCE97C54B" },

src/bridgebot/pprint.gleam

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,17 @@ fn single_dummy_to_string(
4747
lead: Option(card.Card),
4848
details: details.Details,
4949
) -> String {
50-
case lead {
51-
None ->
52-
box.rows([
53-
box.columns([box.hand(north), box.details(details)]),
54-
box.empty(10),
55-
box.hand(south),
56-
])
57-
|> box.to_string
58-
Some(card) ->
59-
box.rows([
60-
box.columns([box.details(details), box.hand(north)]),
61-
box.lead(card),
62-
box.columns([box.empty(10), box.hand(south)]),
63-
])
64-
|> box.to_string
50+
let lead_box = case lead {
51+
None -> box.empty(10)
52+
Some(card) -> box.lead(card)
6553
}
54+
55+
box.rows([
56+
box.columns([box.details(details), box.hand(north)]),
57+
lead_box,
58+
box.columns([box.empty(10), box.hand(south)]),
59+
])
60+
|> box.to_string
6661
}
6762

6863
fn single_hand_to_string(hand: hand.Hand, details: details.Details) -> String {

0 commit comments

Comments
 (0)