Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

SameGame — PowerShell Edition

A fully-featured SameGame puzzle game built entirely in PowerShell using Windows Forms and GDI+. No external dependencies — just PowerShell 5.1 and Windows.

Gameplay


Requirements

  • Windows 10 / 11
  • Windows PowerShell 5.1 (built-in on all modern Windows installs)

Quick Start

powershell -ExecutionPolicy Bypass -File SameGame.ps1

Or right-click SameGame.ps1Run with PowerShell.


How to Play

The board starts as a 15 × 10 grid of randomly-colored tiles in five colors.

StepAction
Hover over a tileThe connected group of same-colored tiles lights up and the score preview appears in the top bar
Left-click a highlighted groupRemoves all tiles in the group (groups must have ≥ 2 tiles)
After removalTiles fall under gravity; empty columns collapse left
Game overNo more removable groups remain — the board dims and shows your final score

Hover highlight


Scoring

EventPoints
Remove n tiles(n − 2)²
Clear the entire board+1000 bonus

Larger groups are exponentially more valuable — a group of 10 scores 64 pts, while a group of 20 scores 324 pts.

Group sizeScore
20
31
59
1064
20324

Controls

InputAction
Left clickRemove hovered group
NNew game
New Game [N] buttonNew game

Files

FilePurpose
SameGame.ps1Game source — runs standalone
SameGame.Tests.ps1Self-contained test suite (no Pester required)
AGENTS.mdAI agent / contributor guidelines

Running the tests

powershell -ExecutionPolicy Bypass -File SameGame.Tests.ps1

Technical Details

  • Rendering — Double-buffered Panel subclass (SameGamePanel) via Add-Type eliminates flicker
  • Flood fill — BFS with two parallel Queue[int] (rows / cols) to find connected groups in O(n)
  • Gravity — In-place downward pack per column; empty columns then shift left
  • Hover performanceHashSet[int] cell-key cache skips flood-fill recalculation when the cursor stays inside the same group
  • Tile style — Drop shadow → flat face → top-left specular triangle → bottom-right dark triangle → border

About

SameGame implementation in PowerShell

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages