Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d9f4fc1
Review the EN heading format.
krahets Dec 30, 2025
ddd9a19
Fix pythontutor headings.
krahets Dec 30, 2025
59f6c71
Fix pythontutor headings.
krahets Dec 30, 2025
94dbc59
bug fixes
krahets Dec 30, 2025
1460011
Fix headings in **/summary.md
krahets Dec 30, 2025
7137cea
Revisit the CN-to-EN translation for Python code using Claude-4.5
krahets Dec 30, 2025
dd299b8
Revisit the CN-to-EN translation for Java code using Claude-4.5
krahets Dec 30, 2025
314350a
Revisit the CN-to-EN translation for Cpp code using Claude-4.5.
krahets Dec 30, 2025
d6d6187
Fix the dictionary.
krahets Dec 30, 2025
8441eef
Fix cpp code translation for the multipart strings.
krahets Dec 30, 2025
6fefc9a
Translate Go code to English.
krahets Dec 30, 2025
b7778ed
Update workflows to test EN code.
krahets Dec 30, 2025
75521c9
Add EN translation for C.
krahets Dec 30, 2025
bee2194
Add EN translation for CSharp.
krahets Dec 30, 2025
e49f07f
Add EN translation for Swift.
krahets Dec 30, 2025
0744bad
Trigger the CI check.
krahets Dec 30, 2025
c057c0a
Revert.
krahets Dec 30, 2025
e7c1d3d
Update en/hash_map.md
krahets Dec 30, 2025
4432225
Add the EN version of Dart code.
krahets Dec 30, 2025
0e514f7
Add the EN version of Kotlin code.
krahets Dec 30, 2025
5d67875
Add missing code files.
krahets Dec 30, 2025
1bd4d81
Add the EN version of JavaScript code.
krahets Dec 30, 2025
b193ad2
Add the EN version of TypeScript code.
krahets Dec 30, 2025
0acf4c3
Fix the workflows.
krahets Dec 30, 2025
82668e7
Add the EN version of Ruby code.
krahets Dec 30, 2025
06225a5
Add the EN version of Rust code.
krahets Dec 30, 2025
32ddbc7
Update the CI check for the English version code.
krahets Dec 30, 2025
50c8169
Update Python CI check.
krahets Dec 30, 2025
72855d8
Fix cmakelists for en/C code.
krahets Dec 30, 2025
9a4d483
Fix Ruby comments
krahets Dec 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 15 additions & 6 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ name: C
on:
push:
branches: ["main"]
paths: ["codes/c/**/*.c", "codes/c/**/*.h"]
paths:
- "codes/c/**/*.c"
- "codes/c/**/*.h"
- "en/codes/c/**/*.c"
- "en/codes/c/**/*.h"
pull_request:
branches: ["main"]
paths: ["codes/c/**/*.c", "codes/c/**/*.h"]
paths:
- "codes/c/**/*.c"
- "codes/c/**/*.h"
- "en/codes/c/**/*.c"
- "en/codes/c/**/*.h"
workflow_dispatch:

jobs:
Expand All @@ -30,6 +38,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
code-dir: ["codes/c", "en/codes/c"]
include:
- os: windows-latest
c_compiler: cl
Expand All @@ -55,18 +64,18 @@ jobs:
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ github.workspace }}/codes/c/build
cmake -B ${{ github.workspace }}/${{ matrix.code-dir }}/build
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}/codes/c
-S ${{ github.workspace }}/${{ matrix.code-dir }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ github.workspace }}/codes/c/build --config ${{ matrix.build_type }}
run: cmake --build ${{ github.workspace }}/${{ matrix.code-dir }}/build --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ github.workspace }}/codes/c/build
working-directory: ${{ github.workspace }}/${{ matrix.code-dir }}/build
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }}
21 changes: 15 additions & 6 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ name: C++
on:
push:
branches: ["main"]
paths: ["codes/cpp/**/*.cpp", "codes/cpp/**/*.hpp"]
paths:
- "codes/cpp/**/*.cpp"
- "codes/cpp/**/*.hpp"
- "en/codes/cpp/**/*.cpp"
- "en/codes/cpp/**/*.hpp"
pull_request:
branches: ["main"]
paths: ["codes/cpp/**/*.cpp", "codes/cpp/**/*.hpp"]
paths:
- "codes/cpp/**/*.cpp"
- "codes/cpp/**/*.hpp"
- "en/codes/cpp/**/*.cpp"
- "en/codes/cpp/**/*.hpp"
workflow_dispatch:

jobs:
Expand All @@ -30,6 +38,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
code-dir: ["codes/cpp", "en/codes/cpp"]
include:
- os: windows-latest
c_compiler: cl
Expand All @@ -55,18 +64,18 @@ jobs:
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ github.workspace }}/codes/cpp/build
cmake -B ${{ github.workspace }}/${{ matrix.code-dir }}/build
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}/codes/cpp
-S ${{ github.workspace }}/${{ matrix.code-dir }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ github.workspace }}/codes/cpp/build --config ${{ matrix.build_type }}
run: cmake --build ${{ github.workspace }}/${{ matrix.code-dir }}/build --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ github.workspace }}/codes/cpp/build
working-directory: ${{ github.workspace }}/${{ matrix.code-dir }}/build
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }}
15 changes: 10 additions & 5 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ name: Dart
on:
push:
branches: ["main"]
paths: ["codes/dart/**/*.dart"]
paths:
- "codes/dart/**/*.dart"
- "en/codes/dart/**/*.dart"
pull_request:
branches: ["main"]
paths: ["codes/dart/**/*.dart"]
paths:
- "codes/dart/**/*.dart"
- "en/codes/dart/**/*.dart"
workflow_dispatch:

permissions:
Expand All @@ -22,15 +26,16 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
dart-sdk: [stable]
code-dir: ["codes/dart", "en/codes/dart"]
steps:
- uses: actions/checkout@v4
- name: Set up Dart ${{ matrix.dart-sdk }}
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart-sdk}}
- name: Run format
run: dart format codes/dart
run: dart format ${{ matrix.code-dir }}
- name: Run analyze
run: dart analyze codes/dart
run: dart analyze ${{ matrix.code-dir }}
- name: Run build
run: dart codes/dart/build.dart
run: dart ${{ matrix.code-dir }}/build.dart
37 changes: 21 additions & 16 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ name: .NET

on:
push:
branches: [ "main" ]
paths: ["codes/csharp/**/*.cs"]
branches: ["main"]
paths:
- "codes/csharp/**/*.cs"
- "en/codes/csharp/**/*.cs"
pull_request:
branches: [ "main" ]
paths: ["codes/csharp/**/*.cs"]
branches: ["main"]
paths:
- "codes/csharp/**/*.cs"
- "en/codes/csharp/**/*.cs"
workflow_dispatch:

jobs:
Expand All @@ -18,22 +22,23 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: codes/csharp/
working-directory: ${{ matrix.code-dir }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
dotnet-version: ["8.0.x"]
code-dir: ["codes/csharp", "en/codes/csharp"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore hello-algo.csproj
- name: Build
run: dotnet build --no-restore hello-algo.csproj
- name: Test with dotnet
run: dotnet test hello-algo.csproj
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore hello-algo.csproj
- name: Build
run: dotnet build --no-restore hello-algo.csproj
- name: Test with dotnet
run: dotnet test hello-algo.csproj
37 changes: 21 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: Go

on:
push:
branches: [ "main" ]
paths: ["codes/go/**/*.go"]
branches: ["main"]
paths:
- "codes/go/**/*.go"
- "en/codes/go/**/*.go"
pull_request:
branches: [ "main" ]
paths: ["codes/go/**/*.go"]
branches: ["main"]
paths:
- "codes/go/**/*.go"
- "en/codes/go/**/*.go"
workflow_dispatch:

jobs:
Expand All @@ -15,22 +19,23 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: codes/go/
working-directory: ${{ matrix.code-dir }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ["1.19.x"]
code-dir: ["codes/go", "en/codes/go"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
run: go get -v -t -d ./...
- name: Build
run: go build -v ./...
- name: Test with Go
run: go test -v ./...
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
run: go get -v -t -d ./...
- name: Build
run: go build -v ./...
- name: Test with Go
run: go test -v ./...
19 changes: 12 additions & 7 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,30 @@ name: Java

on:
push:
branches: [ "main" ]
paths: ["codes/java/**/*.java"]
branches: ["main"]
paths:
- "codes/java/**/*.java"
- "en/codes/java/**/*.java"
pull_request:
branches: [ "main" ]
paths: ["codes/java/**/*.java"]
branches: ["main"]
paths:
- "codes/java/**/*.java"
- "en/codes/java/**/*.java"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '11', '17' ]
java: ["11", "17"]
code-dir: ["codes/java", "en/codes/java"]
name: Java ${{ matrix.Java }} sample
steps:
- uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: "temurin"
java-version: ${{ matrix.java }}
- run: javac -d codes/java/build codes/java/**/*.java
- run: javac -d ${{ matrix.code-dir }}/build ${{ matrix.code-dir }}/**/*.java
15 changes: 10 additions & 5 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: JavaScript

on:
push:
branches: ['main']
paths: ['codes/javascript/**/*.js']
branches: ["main"]
paths:
- "codes/javascript/**/*.js"
- "en/codes/javascript/**/*.js"
pull_request:
branches: ['main']
paths: ['codes/javascript/**/*.js']
branches: ["main"]
paths:
- "codes/javascript/**/*.js"
- "en/codes/javascript/**/*.js"
workflow_dispatch:

jobs:
Expand All @@ -15,6 +19,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
code-dir: ["codes/javascript", "en/codes/javascript"]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
Expand All @@ -24,4 +29,4 @@ jobs:
with:
deno-version: v2.x
- name: Run JavaScript Code
run: deno run -A codes/javascript/test_all.js
run: deno run -A ${{ matrix.code-dir }}/test_all.js
17 changes: 11 additions & 6 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,28 @@ name: Kotlin

on:
push:
branches: [ "main" ]
paths: ["codes/kotlin/**/*.kt"]
branches: ["main"]
paths:
- "codes/kotlin/**/*.kt"
- "en/codes/kotlin/**/*.kt"
pull_request:
branches: [ "main" ]
paths: ["codes/kotlin/**/*.kt"]
branches: ["main"]
paths:
- "codes/kotlin/**/*.kt"
- "en/codes/kotlin/**/*.kt"
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
os: [ubuntu-latest, macos-latest]
code-dir: ["codes/kotlin", "en/codes/kotlin"]

name: Kotlin on ${{ matrix.os }}
steps:
- uses: actions/[email protected]

- name: Build JAR
run: kotlinc codes/kotlin/**/*.kt -include-runtime -d codes/kotlin/build/test.jar
run: kotlinc ${{ matrix.code-dir }}/**/*.kt -include-runtime -d ${{ matrix.code-dir }}/build/test.jar
15 changes: 10 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ name: Python
on:
push:
branches: ["main"]
paths: ["codes/python/**/*.py"]
paths:
- "codes/python/**/*.py"
- "en/codes/python/**/*.py"
pull_request:
branches: ["main"]
paths: ["codes/python/**/*.py"]
paths:
- "codes/python/**/*.py"
- "en/codes/python/**/*.py"
workflow_dispatch:

permissions:
Expand All @@ -22,7 +26,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]
python-version: ["3.10"]
code-dir: ["codes/python", "en/codes/python"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -35,7 +40,7 @@ jobs:
pip install black
- name: Lint with black
run: |
black codes/python
black ${{ matrix.code-dir }}
- name: Test python code
run: |
python codes/python/test_all.py
cd ${{ matrix.code-dir }} && python test_all.py
Loading
Loading