> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/games/memory.md).

# Memory

<figure><img src="https://1591991476-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPIxZnZDGzl5v0n1I2OKQ%2Fuploads%2F86ptkEORdQCuAImVi9J7%2Fimage.png?alt=media&amp;token=ae1516e3-8a25-4891-a00a-9f7725286f10" alt=""><figcaption></figcaption></figure>

A grid of face-down cards, each hiding a gem icon. The player flips two cards at a time — matching pairs stay face-up. Find all pairs before time runs out to win.

## Options

| Option  | Type   | Default | Description                                                                                     |
| ------- | ------ | ------- | ----------------------------------------------------------------------------------------------- |
| `pairs` | number | `6`     | Number of unique gem pairs. Total cards on the board = `pairs × 2`. Maximum 8 pairs (16 cards). |
| `time`  | number | `60`    | Time limit in seconds. A floor of `pairs × 7` seconds is enforced regardless of this value.     |

## Example

```lua
-- Quick puzzle with few pairs:
exports['jiffy-minigames']:Memory({
    pairs = 4,
    time  = 40,
}, function(success)
    if success then
        TriggerServerEvent('my-script:server:unlock')
    end
end)

-- Larger board with tight timer:
local success = exports['jiffy-minigames']:Memory({
    pairs = 8,
    time  = 56,  -- exactly the floor (8 * 7), effectively max pressure
})
```

## Notes

* Cards are shuffled every run — no fixed layout.
* The `difficulty` preset does not affect Memory (round count and speed are not applicable). Tune it exclusively via `pairs` and `time`.
* Setting `time` below the `pairs × 7` floor is silently ignored — the floor exists to ensure the game is theoretically completable.
