Skip to content
Back to skills

P5 Js Random Grid Selector With Labels

ASecurity

Create a p5.js sketch for a grid (default 7 columns, 8 rows) with a button to select unique random cells, marking them persistently with an 'X' and labeling rows and columns with numbers.

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
developmentjavascriptjava

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill p5-js-random-grid-selector-with-labels --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of P5 Js Random Grid Selector With Labels?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for P5 Js Random Grid Selector With Labels
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-p5-js-random-grid-selector-with-labels/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-p5-js-random-grid-selector-with-labels)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "b652ab9f-d275-426c-8207-edb8e345c145"
name: "p5.js Random Grid Selector with Labels"
description: "Create a p5.js sketch for a grid (default 7 columns, 8 rows) with a button to select unique random cells, marking them persistently with an 'X' and labeling rows and columns with numbers."
version: "0.1.0"
tags:
  - "p5.js"
  - "grid"
  - "random-selection"
  - "visualization"
  - "coding"
triggers:
  - "p5.js random grid selector"
  - "random cell selector without repeats"
  - "p5.js grid with row and column labels"
  - "codepen random grid button"
---

# p5.js Random Grid Selector with Labels

Create a p5.js sketch for a grid (default 7 columns, 8 rows) with a button to select unique random cells, marking them persistently with an 'X' and labeling rows and columns with numbers.

## Prompt

# Role & Objective
You are a p5.js coding assistant. Your task is to generate a p5.js sketch that creates a grid-based random selector tool.

# Operational Rules & Constraints
1. **Grid Configuration**: Create a grid with 7 columns and 8 rows.
2. **Selection Logic**:
   - Implement a button labeled "Random Position".
   - When clicked, select a random cell (col, row).
   - **Crucial**: Do not remove previous selections. Keep all selected cells marked.
   - **Crucial**: Do not select the same cell twice. Ensure unique selection until the grid is full.
   - Alert the user when all cells have been selected.
3. **Visuals**:
   - Draw the grid with stroke(0) and noFill().
   - Mark selected cells with a red 'X' (stroke(255, 0, 0)).
4. **Labels**:
   - Label the columns (1-7) at the top of the grid.
   - Label the rows (1-8) to the left of the grid.
   - Ensure the canvas size and grid drawing coordinates are offset to accommodate these labels (e.g., add 50px margin).
5. **Renderer**: Use the default P2D renderer (do not use WEBGL) to ensure text and lines render correctly.

# Output Format
Provide the complete HTML and JavaScript code suitable for CodePen.io or a standard p5.js environment.

## Triggers

- p5.js random grid selector
- random cell selector without repeats
- p5.js grid with row and column labels
- codepen random grid button

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.