Skip to content

maurorisonho/NeurIPS-2025-Google-Code-Golf-Championship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NeurIPS 2025 Google Code Golf Championship

NeurIPS 2025 Kaggle Competition Code Golf

Human-AI Collaboration Powered by Claude AI-Assisted Development Methodology

Python 3.8+ Jupyter NumPy Pandas

Cross Platform Bash VS Code

Code Style: Black Linting: Flake8 Type Hints

License: MIT Documentation Maintained

A comprehensive development environment for the NeurIPS 2025 Google Code Golf Championship. This repository provides tools, utilities, and analysis notebooks to help participants develop, test, and optimize their solutions.

πŸ› οΈ Technology Stack

This project showcases Human-AI Collaborative Programming, where development tasks are intelligently distributed between human creativity and AI assistance:

🀝 Development Methodology

  • Human-AI Collaboration: Strategic partnership between human developer and Claude AI
  • AI-Assisted Development: Leveraging AI for code generation, optimization, and documentation
  • Interactive Programming: Continuous feedback loop between human insight and AI capabilities

πŸ’» Core Technologies

  • Python 3.8+: Primary programming language with modern features
  • Jupyter Notebooks: Interactive development and analysis environment
  • NumPy & Pandas: Data manipulation and numerical computing
  • Cross-Platform Support: Linux, macOS, and Windows compatibility

πŸ”§ Development Tools

  • VS Code: Optimized development environment
  • Black & Flake8: Code formatting and linting
  • Type Hints: Enhanced code reliability with mypy
  • Bash Scripting: Automation and environment management

πŸ“Š Specialized Features

  • Code Golf Optimization: Character counting and minimization tools
  • Automated Testing: Solution validation and performance metrics
  • Environment Automation: One-command setup and configuration
  • Bilingual Documentation: English and Portuguese support

Author: Mauro Risonho de Paula AssumpΓ§Γ£o License: MIT License Development Model: Human-AI Collaborative Programming

πŸš€ Quick Start

One-Command Setup

# Clone and setup environment
git clone https://github.com/neurips-2025-code-golf/championship.git
cd championship
./setup.py  # or ./setup.sh for bash users

Interactive Quick Start

# After setup, use the interactive quick start
./quick_start.py

This will give you an interactive menu to:

  • πŸ“Š Start Jupyter Notebook for analysis
  • πŸƒ Run demo workflow
  • πŸ” Explore problem structure
  • πŸ§ͺ Test solutions
  • πŸ“ Count characters in solutions
  • πŸ“š View documentation
  • And more!

πŸ“‹ Prerequisites

  • Python 3.8+ (tested with 3.8, 3.9, 3.10, 3.11, 3.12, 3.13)
  • Git for version control
  • Internet connection for downloading dependencies
  • Kaggle account for competition participation

πŸ› οΈ Installation

Automatic Setup (Recommended)

The setup scripts will automatically:

  • Create and configure a Python virtual environment
  • Install all required dependencies
  • Set up Jupyter notebooks with project kernel
  • Configure project structure
  • Verify Kaggle API (if configured)
  • Create activation scripts

Choose your preferred setup method:

Python Setup (Cross-platform):

./setup.py

Bash Setup (Linux/macOS):

./setup.sh

πŸ“ Project Structure

NeurIPS-2025-Google-Code-Golf-Championship/
β”œβ”€β”€ πŸ“„ README.md                          # This file
β”œβ”€β”€ πŸš€ setup.py                          # Cross-platform setup script
β”œβ”€β”€ πŸš€ setup.sh                          # Bash setup script
β”œβ”€β”€ πŸš€ quick_start.py                    # Interactive quick start
β”œβ”€β”€ βš™οΈ  activate.sh                       # Environment activation
β”œβ”€β”€ πŸ“‹ requirements.txt                   # Python dependencies
β”œβ”€β”€ πŸ“š SETUP.md                          # Detailed setup guide
β”œβ”€β”€ 🎯 KAGGLE_SETUP.md                   # Kaggle configuration
β”œβ”€β”€ πŸ“– REFACTORING_SUMMARY.md            # Project documentation
β”œβ”€β”€ πŸ“‚ problems/                         # Competition problems
β”‚   β”œβ”€β”€ problem_01/
β”‚   β”‚   β”œβ”€β”€ description.md
β”‚   β”‚   β”œβ”€β”€ solutions/
β”‚   β”‚   β”‚   └── solution.py
β”‚   β”‚   └── test_cases/
β”‚   └── problem_XX/
β”œβ”€β”€ πŸ› οΈ  utils/                           # Utility tools
β”‚   β”œβ”€β”€ count_chars.py                   # Character counting
β”‚   β”œβ”€β”€ test_solution.py                 # Solution testing
β”‚   └── create_problem.py                # Problem creation
β”œβ”€β”€ 🎬 scripts/                          # Automation scripts
β”‚   └── demo_workflow.py                 # Demo workflow
β”œβ”€β”€ πŸ“Š notebooks/                        # Analysis notebooks
β”‚   β”œβ”€β”€ analysis_notebook_EN.ipynb       # English analysis
β”‚   └── analysis_notebook_PT_BR.ipynb    # Portuguese analysis
β”œβ”€β”€ πŸ“š docs/                             # Documentation
β”‚   └── code_golf_guide.md               # Code golf strategies
β”œβ”€β”€ πŸ“¦ submissions/                      # Competition submissions
└── πŸ“ logs/                            # Log files

πŸ”§ Core Tools

Character Counter (utils/count_chars.py)

Count characters in your solutions to optimize for code golf:

python utils/count_chars.py path/to/solution.py

Features:

  • Multiple counting methods (total, no-whitespace, minimal)
  • Detailed analysis with breakdown
  • Code golf optimization suggestions

Solution Tester (utils/test_solution.py)

Test your solutions locally before submission:

python utils/test_solution.py path/to/solution.py

Features:

  • Automated test case execution
  • Output format validation
  • Performance timing
  • Error reporting

Problem Creator (utils/create_problem.py)

Create new problem structures:

python utils/create_problem.py problem_name "Problem Description"

πŸ“Š Analysis Notebooks

English Analysis (notebooks/analysis_notebook_EN.ipynb)

  • Code golf strategy analysis
  • Character optimization techniques
  • Statistical analysis of solutions
  • Performance benchmarking

Portuguese Analysis (notebooks/analysis_notebook_PT_BR.ipynb)

  • AnΓ‘lise de estratΓ©gias de code golf
  • TΓ©cnicas de otimizaΓ§Γ£o de caracteres
  • AnΓ‘lise estatΓ­stica de soluΓ§Γ΅es
  • Benchmarking de performance

πŸ† Competition Workflow

1. Environment Setup

# Initial setup
./setup.py

# Activate environment
source activate.sh

2. Problem Analysis

# Start interactive environment
./quick_start.py

# Or manually start Jupyter
jupyter notebook

3. Solution Development

# Create new problem structure
python utils/create_problem.py problem_05 "New Problem"

# Develop solution in problems/problem_05/solutions/

# Test solution
python utils/test_solution.py problems/problem_05/solutions/solution.py

4. Optimization

# Count characters for optimization
python utils/count_chars.py problems/problem_05/solutions/solution.py

# Use analysis notebooks for optimization strategies
jupyter notebook notebooks/analysis_notebook_EN.ipynb

5. Submission

# Prepare submission
cp problems/problem_05/solutions/solution.py submissions/

# Submit via Kaggle (see KAGGLE_SETUP.md)
kaggle competitions submit -c competition-name -f submissions/solution.py -m "Optimized solution"

🎯 Code Golf Strategies

Character Optimization Techniques

  1. Variable Names: Use single letters (a, b, c)
  2. Compact Syntax: Prefer x+=1 over x=x+1
  3. List Comprehensions: More compact than loops
  4. Built-in Functions: Leverage Python's rich standard library
  5. Lambda Functions: For short, inline operations
  6. String Operations: Use format strings and join operations
  7. Mathematical Shortcuts: Use //, %, ** operators efficiently

Python Golf Tricks

# Instead of multiple lines
if condition:
    result = value1
else:
    result = value2

# Use ternary operator
result = value1 if condition else value2

# Instead of range loops
for i in range(len(items)):
    process(items[i])

# Use enumerate or direct iteration
for i, item in enumerate(items):
    process(item)

See docs/code_golf_guide.md for comprehensive strategies.

πŸ”— Kaggle Integration

Setup Kaggle API

  1. Create account at kaggle.com
  2. Go to Account β†’ API β†’ Create New Token
  3. Download kaggle.json to ~/.kaggle/
  4. Set permissions: chmod 600 ~/.kaggle/kaggle.json

See KAGGLE_SETUP.md for detailed instructions.

Competition Commands

# List competitions
kaggle competitions list

# Download data
kaggle competitions download -c competition-name

# Submit solution
kaggle competitions submit -c competition-name -f solution.py -m "Message"

# Check leaderboard
kaggle competitions leaderboard -c competition-name

πŸ§ͺ Testing Framework

Running Tests

# Test specific solution
python utils/test_solution.py problems/problem_01/solutions/solution.py

# Run demo workflow
python scripts/demo_workflow.py

# Test all solutions (if implemented)
pytest tests/  # When test suite is added

Test Case Format

Test cases should follow this structure:

problems/problem_XX/test_cases/
β”œβ”€β”€ input_01.txt
β”œβ”€β”€ expected_01.txt
β”œβ”€β”€ input_02.txt
β”œβ”€β”€ expected_02.txt
└── ...

πŸ“ˆ Performance Monitoring

Character Counting

The character counter provides multiple metrics:

  • Total characters: Including all whitespace and comments
  • No-whitespace: Excluding spaces, tabs, and newlines
  • Minimal: Most compressed representation
  • Effective: Counting only essential characters

Timing Analysis

Solutions are timed during testing to identify performance bottlenecks.

🀝 Contributing

Adding Problems

# Create problem structure
python utils/create_problem.py problem_name "Description"

# Add test cases to problems/problem_name/test_cases/
# Develop reference solution in problems/problem_name/solutions/

Code Style

  • Follow PEP 8 for readable code
  • Use black for formatting: black file.py
  • Use flake8 for linting: flake8 file.py
  • For golf solutions, optimize for character count over readability

πŸ“š Documentation

πŸ†˜ Troubleshooting

Common Issues

Environment not activated:

source activate.sh  # Always activate before working

Import errors:

pip install -r requirements.txt  # Reinstall dependencies

Kaggle API errors:

# Check credentials
ls ~/.kaggle/kaggle.json
# Reconfigure if needed - see KAGGLE_SETUP.md

Jupyter kernel issues:

# Reinstall kernel
python -m ipykernel install --user --name=neurips-code-golf --display-name="NeurIPS Code Golf"

Getting Help

  1. Interactive Help: Run ./quick_start.py and select option 9
  2. Documentation: Check files in docs/ directory
  3. Issues: Report bugs on GitHub repository
  4. Community: Join competition discussions on Kaggle

πŸ“„ License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2025 Mauro Risonho de Paula AssumpΓ§Γ£o

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

🌟 Acknowledgments

  • NeurIPS 2025 - For hosting the championship
  • Google - For sponsoring the code golf competition
  • Kaggle - For providing the competition platform
  • Python Community - For the amazing tools and libraries

🀝 Human-AI Collaborative Development

This project exemplifies modern Human-AI Collaborative Programming, demonstrating how human creativity and AI capabilities can work together to create superior software solutions:

🧠 Human Contributions

  • Strategic Architecture: Overall project design and structural decisions
  • Domain Knowledge: Code golf expertise and competition strategy
  • Creative Problem Solving: Innovative approaches to optimization challenges
  • User Experience Design: Intuitive interfaces and workflow design
  • Quality Assurance: Testing, validation, and performance optimization

πŸ€– AI Contributions (Claude 3.5 Sonnet)

  • Code Generation: Automated creation of boilerplate and utility functions
  • Documentation: Comprehensive guides, comments, and API documentation
  • Translation: Portuguese-to-English content localization
  • Optimization: Code golf techniques and character minimization strategies
  • Environment Setup: Cross-platform automation and configuration scripts

πŸ”„ Collaborative Workflow

  1. Human defines requirements and strategic goals
  2. AI generates initial implementation and documentation
  3. Human reviews, refines, and provides domain expertise
  4. AI iterates based on feedback and optimizes solutions
  5. Human validates final output and ensures quality standards

πŸ“ˆ Results of Collaboration

  • 50+ files created/enhanced through Human-AI partnership
  • Complete bilingual documentation (English + Portuguese)
  • Cross-platform automation with professional-grade setup scripts
  • Comprehensive testing framework with optimization tools
  • Professional-grade project structure ready for competition use

🎯 Key Benefits Achieved

  • ⚑ Speed: Faster development through AI assistance
  • 🎨 Quality: Human oversight ensures excellence
  • πŸ”„ Consistency: AI maintains uniform documentation and coding standards
  • 🌍 Accessibility: Bilingual support and comprehensive guides
  • πŸš€ Innovation: Combined human creativity with AI efficiency

This project demonstrates the future of software development - where human intelligence and artificial intelligence work in harmony to achieve results neither could accomplish alone.

πŸ”— Links


Ready to golf some code? πŸŒοΈβ€β™‚οΈ

Start with ./quick_start.py and let the interactive menu guide you through your first steps!

Good luck in the championship! πŸ†

About

NeurIPS 2025 Google Code Golf Championship - Implement a variety of programs using the fewest number of characters!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published