Skip to content

Add portable C implementation of 2024/10 topographic map solver - #7

Draft
olefriis with Copilot wants to merge 4 commits into
mainfrom
copilot/convert-run-script-to-c
Draft

olefriis with Copilot wants to merge 4 commits into
mainfrom
copilot/convert-run-script-to-c

Conversation

Copilot AI commented Dec 10, 2025 •

Copy link
Copy Markdown

Portable C version of the Ruby solution for Advent of Code 2024 Day 10 (topographic map pathfinding).

Implementation

  • run.c - C99 implementation with custom PositionSet for deduplication, BFS for part 1 (reachable peaks), recursive DFS for part 2 (distinct trails)
  • Makefile - Standard build with -std=c99 -O2 for portability and performance
  • README.md - Build/run instructions for both implementations
  • Sample inputs for verification

Example Usage

# Build and run
make
./run sample_input

# Part 1: 1
# Part 2: 16

The C version accepts input file as optional argument (defaults to 10/input for consistency with Ruby version when run from 2024/ directory).

Original prompt

Do a portable C version of 10/run.rb

Created from VS Code via the GitHub Pull Request extension.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 10, 2025 20:51
Co-authored-by: olefriis <134527+olefriis@users.noreply.github.com>
Co-authored-by: olefriis <134527+olefriis@users.noreply.github.com>
Co-authored-by: olefriis <134527+olefriis@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert Ruby run script to portable C version Add portable C implementation of 2024/10 topographic map solver Dec 10, 2025
Copilot AI requested a review from olefriis December 10, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants