Skip to content

qszhu/nim-leetcode-cmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build

Warning

Experimental. USE AT YOUR OWN RISK.

在正式比赛中使用的风险未知.

Getting started

  • Login in your preferred browser (Chrome/Edge/Firefox).
  • Close the browser and make sure no browser processes are running.
  • In a new folder, run nlcc:
$ nlcc
Choose browser [firefox|chrome|edge] (chrome): [Enter]
Browser profile path (/Users/whoami/Library/Application Support/Google/Chrome/Default): [Enter]
Choose language [nimjs|nimwasm|python3]: python3[Enter]
第 132 场双周赛
Starts in: 0 days, 4 hours, 16 minutes, 12 seconds.

Browser profile paths

If you have only one browser profile, just accept the default profile path. Otherwise, find the profile path for the current profile:

Chrome

  • Type chrome://version in the address bar.
  • Copy the value of Profile Path (个人资料路径).

Edge

  • Type edge://version in the address bar.
  • Copy the value of Profile Path (个人资料路径).

Firefox

  • Type about://profiles in the address bar.
  • Copy the value of Root Directory of the desired profile.

Commands

$ nlcc help

Code templates

Code templates reside in respective folders in tmpl. Change the templates as needed (i.e. adding imports, code snippets, etc.), but leave the template variables intact.

Editor

Visual Studio Code is hard-coded as the code editor and diff tool at the moment. May be configurable in the future.

Local test (Experimental)

  • Install Docker.
  • Build docker image:
$ cd docker/python3
$ build.bat # windows
$ build.sh # others
  • Use nlcc test -l instead of nlcc test to test locally

Local debug (Experimental)

  • Install Docker.
  • Build docker image:
$ cd docker/python3
$ build.bat # windows
$ build.sh # others
  • In your Python code, add breakpoint() to set breakpoints.
  • Run nlcc debug.
  • In VS Code, select the Run and Debug(运行和调试) tab, and launch nlcc debug. The debugger should stop at the first breakpoint.

Develop

New language support

Add new implementations of BaseProject to src/projects/. For example Python3Project. Pull requests are welcome.

Cross-compilation for windows

  • Install zig
$ brew install zig # OSX
  • Build
$ ./build.sh

TODO

  • Browsers and OSes
Firefox Chrome Edge
Mac OS
Windows
Linux
  • more langauges
    • python
    • javascript
    • typescript
    • java
    • kotlin
    • cpp
    • go
    • rust
  • extract sample outputs from problem description
  • generate test cases according to problem description
  • docker env
    • python
    • javascript
    • limit memory and runtime
    • publish to hub
  • support for global site
  • support for multiple browser profiles
  • protect extracted session
  • realtime contest ratings
  • compatibility with old folder structure
    • compatibility with old code template
  • github actions
    • build
    • release
  • split test cases
  • custom data structures

Implementation details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages