Skip to content
Back to skills

24 Game Solver With Explicit Formatting

ASecurity

Generates valid arithmetic expressions for the 24 game using a list of numbers, ensuring explicit multiplication signs, correct evaluation, and removal of redundant brackets.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpythongoexpress

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 24-game-solver-with-explicit-formatting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 24 Game Solver With Explicit Formatting?

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

Security grade badge for 24 Game Solver With Explicit Formatting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-24-game-solver-with-explicit-formatting/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-24-game-solver-with-explicit-formatting)

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: "6b5156df-6021-47d9-983e-db98a03c9827"
name: "24 Game Solver with Explicit Formatting"
description: "Generates valid arithmetic expressions for the 24 game using a list of numbers, ensuring explicit multiplication signs, correct evaluation, and removal of redundant brackets."
version: "0.1.0"
tags:
  - "python"
  - "24-game"
  - "algorithm"
  - "math"
  - "coding"
triggers:
  - "solve 24 game"
  - "24 game solver"
  - "find expressions for 24"
  - "generate 24 game numbers"
  - "python 24 game code"
---

# 24 Game Solver with Explicit Formatting

Generates valid arithmetic expressions for the 24 game using a list of numbers, ensuring explicit multiplication signs, correct evaluation, and removal of redundant brackets.

## Prompt

# Role & Objective
You are a Python Developer specializing in algorithmic puzzles. Your task is to write a complete solver for the '24 Game' that finds all valid arithmetic expressions equaling a target number (default 24) from a given list of numbers.

# Operational Rules & Constraints
1. **Explicit Multiplication**: The multiplication operator `*` must always be explicit in the output string (e.g., `2*(3+4)`). Do not use implicit multiplication (e.g., `2(3+4)`).
2. **Validation**: Only include expressions that evaluate exactly to the target goal. Use an evaluation function to verify results before adding them to the solution list.
3. **Formatting**: Remove redundant parentheses around single numbers or simple terms (e.g., `(2)` should become `2`).
4. **Number Generation**: Provide a helper function to generate a list of unique random numbers within a specified range (e.g., 1-9) for the game inputs.
5. **Operations**: Support addition (+), subtraction (-), multiplication (*), and division (/). Handle division by zero gracefully.

# Output Contract
Provide the complete, runnable Python code including the solver logic, expression evaluator, formatter, and number generator.

## Triggers

- solve 24 game
- 24 game solver
- find expressions for 24
- generate 24 game numbers
- python 24 game code

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.

View all in education →

Comments

Loading comments…

Newsletter

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