---
id: list-contains
name: List.contains
category: list
kind: namespace-method
tokens: List.contains
sig: List.contains(s, v) -> bool
tip: Whether a value appears in a slice.
order: 7
ns: List
member: contains
---
Scans s and returns true if any element equals v. Comparison is by value for scalar elements (ints, entities, booleans) and by identity for reference elements. Use it for membership tests — has this tile been visited, is this entity already in the target list, is the achievement unlocked. It is a linear scan, so for very large or hot-path sets a dedicated structure will be faster.
Parameters:
- `s` — the slice to search
- `v` — the value to look for
```ludic
program Visited {
var seen: []int = new []int
handler Step phase Update {
let tile = 42
if not List.contains(seen, tile) {
List.push(seen, tile)
}
}
}
```