A terminal UI for competitive programming.
- Run test cases against source files
- Competitive Companion integration for automatic test case retrieval
- Mouse support for panel selection and scrolling
- Configurable language engines for compilation and execution
go install github.com/thecomputerm/lazycph@mainRun in the current directory to open the file picker:
lazycphOpen a specific solution file:
lazycph path/to/solution.cppEnable Competitive Companion integration:
lazycph --companionCustom engines can be defined in ~/.config/lazycph.json. This file merges with the default configuration. Use {file} as a placeholder for the source file and {temp} for the compiled binary path.
{
"engines": {
".cpp": {
"mode": "compile",
"command": ["g++", "{file}", "-o", "{temp}", "-O3", "-std=c++20"]
},
".js": {
"mode": "interpret",
"command": ["node", "{file}"]
}
}
}LazyCPH integrates with the Competitive Companion browser extension. When running with the --companion or -c flag, LazyCPH listens on standard ports for problem data. Sending a problem from the browser will trigger a dialog to create the source file and automatically populate it with the provided test cases.
You can easily integrate LazyCPH with the Zed editor for a seamless competitive programming experience. You just need to configure a task and bind it to a shortcut key.
// ~/config/zed/keymap.json
{
"context": "Workspace",
"bindings": {
"alt-g": [
"task::Spawn",
{ "task_name": "lazycph", "reveal_target": "center" }
]
}
}go build -o lazycph .MIT
