Nim is a two-player mathematical game of strategy in which players take turns removing objects from istinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap.