Skip to content

orassayag/codewars

Codewars

A JavaScript kata collection with problem statements, community-style solutions, and personal implementations from Codewars. Built in May 2021, the project is intentionally lightweight and focused on readable, runnable kata files for daily practice, learning, and review. Each kata includes clean JavaScript solutions, structured explanations, and a focus on problem-solving patterns and incremental skill progression.

Features

Core Capabilities

  • Multi-Approach Solutions: Side-by-side "community" and "my solution" approaches in many files.
  • Problem Statements: Every kata includes its full description and problem statement.
  • Verification Ready: Built-in console.log examples for quick verification of results.

Technical Excellence

  • Modern JavaScript: Implementations using modern ES6+ features and best practices.
  • Readable Implementations: Focus on clear, maintainable code over complex one-liners.
  • Minimalist Design: Zero-configuration project designed for immediate execution.

Developer Experience

  • Fast Iteration: Run any kata file directly with Node.js without a build step.
  • Daily Practice: Optimized for algorithm practice, review, and experimentation.
  • Easy Onboarding: Clear setup instructions with minimal dependency requirements.

Getting Started

Prerequisites

  • Node.js (v12+ recommended)
  • npm or pnpm
  • Any code editor (VS Code recommended)

Installation

  1. Clone the repository:
git clone https://github.com/orassayag/codewars.git
cd codewars
  1. Install dependencies:
npm install

Configuration

The project uses a minimalist configuration approach:

  • .prettierrc: Ensures consistent code formatting across all kata solutions.
  • eslint.config.mjs: Basic linting rules to maintain code quality and best practices.
  • package.json: Manages the lightweight dependency set and metadata.

Usage

Running Katas

Run any kata file directly with Node:

node src/katas/duplicateEncoder.js

Adding New Katas

  1. Create a new file in src/katas/ (e.g., someKataName.js).
  2. Add the kata description at the top of the file.
  3. Add your solution and an optional community solution.
  4. Add console.log calls at the bottom to verify the output.

Available Scripts

  • node src/katas/<kata-file>.js: Executes the solution for a specific kata.
  • npm stop: Utility to kill running node processes (Windows environments).

Development

Adding a New Solution

When contributing or adding new solutions, follow the established pattern of including the problem statement followed by the implementation and test cases.

Code Quality

  • Formatting: Run Prettier to ensure the code matches the project's style.
  • Linting: Check for potential errors using ESLint rules.

Architecture Principles

  1. Lightweight and Fast: Avoids complex build systems and heavy dependencies.
  2. File-Based Organization: Each kata is a self-contained unit of logic.
  3. Comparative Learning: Prioritizes showing multiple ways to solve the same problem.
  4. Runnable by Default: Every solution file should be executable in a standard Node.js environment.

Architecture

The project follows a simple, flat structure focused on ease of access and readability:

Directory Structure

codewars/
├── src/
│   └── katas/                   # Individual kata solution files
│       ├── duplicateEncoder.js
│       ├── firstNonRepeatingCharacter.js
│       ├── yourOrderPlease.js
│       └── ...                  # More kata files
├── INSTRUCTIONS.md              # Quick setup and usage guide
├── CONTRIBUTING.md              # Contribution guidelines
├── package.json
└── README.md

Design Patterns

  • Functional Programming: Heavy use of map, filter, reduce, and other array methods.
  • Procedural Logic: Straightforward implementations for clarity and educational value.
  • Comparison Pattern: Structuring files to show community vs. personal solutions.

Best Practices

  • Naming: File names should be descriptive and based on the kata name.
  • Structure: Maintain the pattern: Description -> Community Solution -> My Solution -> Examples.
  • Readability: Use meaningful variable names and avoid unnecessary complexity.
  • Verification: Always include sample calls with expected outputs in the file.

Support

For questions, issues, or contributions:

Contributing

Contributions are welcome, including:

  • New kata solutions
  • Improvements to existing implementations
  • Better readability and edge-case handling
  • Documentation updates

See CONTRIBUTING.md for details.

Author

License

This application has an MIT license - see the LICENSE file for details.

Acknowledgments

  • Built for educational and research purposes
  • Respects robots.txt and implements rate limiting
  • Uses user-agent rotation to avoid detection
  • Implements polite crawling practices

About

A JavaScript kata collection featuring problem statements, community-style solutions, and my own implementations from Codewars. Built in May 2021, this lightweight project focuses on readable, runnable kata files for daily practice, learning, and review with clean solutions and problem-solving patterns. Focus on consistency and gradual improvement

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors