Skip to content

feat: rearrange_hand #22

@S1M0N38

Description

@S1M0N38

Re-implement the rearrange_hand from the original repo.

function name: rearrange_hand
arguments: {"cards": list[int]}

The list of cards is in the new order of the cards specified by the old index (0-based index). For example:

{"cards": [0, 2, 1, 3]}

Meaning:

  • card in position 0 stays in position 0 (first card)
  • card in old position 3 (index 2) is now moved to the second spot (new index 1)
  • card in old position 2 (index 1) is now moved to the 3rd place (new index 2)
  • card in the last place (pos 4, index 3) stays in the last spot.

Maybe the field about card order in the game state should be update as well (e.g. order="desc"), but for now it's ok to ignore it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions