Set

Set

Set (card game) – a fascinating card game. The game deck consists of 81 cards, each with one, two, or three of the same symbol (rhombus, oval, or wave) of the same color (red, green, or purple) and texture (shaded, shaded, or outline only). The essence of the game is to find a set - a set of three cards that meets certain conditions.

To understand the rules, read Wikipedia or watch this interesting video.

Get all cards

GET https://shadify.dev/api/set/start

Always returns the same array of 81 objects. Each object corresponds to one of the cards. An example of a card:

{
    "_id": 0,
    "number": 1,
    "shape": "diamond",
    "color": "red",
    "shading": "solid"
}
  • _id - a unique identifier for each card
  • number – number of figures: 1 / 2 / 3
  • shape – body shape: diamond / squiggle / oval
  • color – figure color: red / green / purple
  • shading – figure shading: solid / striped / open

Generating a new game

GET https://shadify.dev/api/set/start
ParameterDescription
possible-setsOptional

A true/false string that enables/disables the search for possible sets in the current layout. The list of possible sets is not necessary for the game and acts only as a hint and evidence that sets exist in the current layout.

Default value is true.

Returned response:

{
	"freeCards": [<69 cards>],
	"layout": [<12 cards>],
	"possibleSets": [[<3 cards>]],
	"wonCards": [],
	"state": "20-4-11-10-12-46-70-62-41-23-3-8"
}
  • freeCards – an array of objects corresponding to free cards that have not yet been used in the game.
  • layout – an array of objects corresponding to the card that are available to play, i.e. to search for sets.
  • possibleSets – array containing arrays that include exactly 3 objects each. Each 3 object corresponds to a combination of three cards forming a set, which can be assembled from the cards available on the current layout.
  • wonCards – an array of objects corresponding to the won cards, which will no longer participate in the game.
  • state – a unique identifier for the current game state. It is needed to perform actions on deleting sets, adding additional cards or just to load the current game state. It has the following form 1-2-3@4-5-6, where the numbers to the left of the sign @ correspond to the unique identifiers of those cards that are in layout, and the numbers on the right are in wonCards.

Load state

GET https://shadify.dev/api/set/<:state>
ParameterDescription
possible-setsOptional

A true/false string that enables/disables the search for possible sets in the current layout.

Default value is true.
actionOptional

The add/remove string, which allows you to perform the appropriate action with the current game state.

The add string adds 3 random cards from the current freeCards array to the current layout (available only if the layout size does not exceed 20 cards).

The remove string removes the specified combination of three cards from the current layout. To do this you must use the cards parameter.

There is no default value.
cardsRequired for action=remove

A string of the form 1-2-3, where each number corresponds to the unique identifier of one of the cards that make up the set.

There is no default value.

Examples of requests with state loading:

https://shadify.dev/api/set/0-27-53-10-46-15-16-64-32-23-29-6?possible-sets=false
https://shadify.dev/api/set/41-47-7-53-13-46-25-36-72-60-15-80?action=add
https://shadify.dev/api/set/0-27-53-10-46-15-16-64-32-23-29-6?action=remove&cards=0-16-23