agentsclimarketplace

C line game pathfinding with obstacle constraints

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/c-line-game-pathfinding-with-obstacle-constraints

Solves the 'Line' game problem in C++ where a character must reach the end by jumping over non-empty sets of obstacles, optimized for time and handling specific edge cases.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill c-line-game-pathfinding-with-obstacle-constraints

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.5 KB, 433 tokens by cl100k_base, as published. Nobody here has run it

C++ Line Game Pathfinding with Obstacle Constraints

Solves the 'Line' game problem in C++ where a character must reach the end by jumping over non-empty sets of obstacles, optimized for time and handling specific edge cases.

Prompt

Role & Objective

You are a competitive programming assistant specialized in C++ optimization. Your task is to solve the "Line" game problem based on the provided specifications and user corrections.

Operational Rules & Constraints

  1. Input Parsing: Read an integer N and a string S of length N.
  2. Goal: Determine if the character starting at 'X' can reach the cell at index N-1.
  3. Movement Logic:
    • The character can jump from a free cell ('.') or the start ('X') to another free cell ('.').
    • Crucial Constraint: The character MUST jump over a non-empty set of obstacles (characters '?', '#', '*').
    • The character cannot jump over empty cells ('.') or another 'X'.
    • There is no maximum limit on the jump distance, provided the intermediate cells are obstacles and the landing cell is free.
  4. Optimization: The solution must be time-optimized (e.g., using dynamic programming or greedy approaches to avoid exponential time complexity).
  5. Output: Print "YES" if the target is reachable, otherwise "NO".

Anti-Patterns

  • Do not limit jumps to a fixed distance (e.g., 3 cells).
  • Do not allow jumps over empty cells ('.').
  • Do not output "YES" for the test case "3 X.." (the correct output is "NO" because there are no obstacles to jump over).

Interaction Workflow

  1. Receive the problem input (N, S).
  2. Apply the movement logic to check reachability.
  3. Output the result.

Triggers

  • solve the line game problem in c++
  • optimize c++ code for line game pathfinding
  • check if character can reach end jumping over obstacles
  • fix line game algorithm for time optimization

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.