Skip to content

👾🎒:neckbeard: My codewars solutions: Ruby, Java, Python, C++, JavaScript, Crystal, Kotlin, CoffeeScript, PHP, Objective-C.

License

Notifications You must be signed in to change notification settings

esotericpig/codewars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codewars

Codewars Badge | esotericpig

This repo contains my solutions from codewars.

Not all of my solutions are listed. A solution will be listed if it is...

  • Interesting and/or difficult or
  • I am learning the language, so I want to have a reference to the code, even if it's trivial.

My coding style here is a bit hackier. Oftentimes, I also try to make it smaller, at the expensive of efficiency, so it is not 100% what I would use in production. However, I did try to make the code readable.

For most (or all) solutions, I added the test cases into "main" (or outside) so that it can be run by itself. I also added additional comments and/or modified the code slightly, so it is not 100% what I submitted.

Enjoy :)

Contents

[ Notes | Favorites | By Rank | Running | License ]

  • Sometimes, there is file2, file3, etc. These are multiple solutions I submitted. Oftentimes, 2, 3, etc. are hackier, while the original is less hacky.
  • For Java solutions, I sometimes renamed the files/classes so that there would not be conflicts and the names would be more descriptive.

Generated by ls_rank.rb (Ruby v2.4+ required).

[ 2 kyu | 3 kyu | 4 kyu | 5 kyu | 6 kyu | 7 kyu ]

This is how I (compile and) run these solutions on my system (Fedora).

The language version is usually just behind the latest version.

If you're familiar with Rake, you can alternatively use this:

$ rake -T

$ rake build -- cpp/build_tower.cc
$ rake run -- cpp/build_tower.cc 33

$ rake build -- java/SimplePigLatin.java
$ rake run -- java/SimplePigLatin.java 'Monkey Burger'

### Dry run.
$ rake clean[t]
### Actually clean.
$ rake clean
  • CoffeeScript:
    • $ sudo npm install --global coffeescript
    • $ coffee <name>.coffee <args>
  • Crystal:
    • $ curl https://dist.crystal-lang.org/rpm/setup.sh | sudo bash
    • $ sudo dnf install crystal
      • Alternatively:
      • $ sudo snap install crystal --classic
    • $ crystal <name>.cr <args>
  • C++:
    • I use a file extension for .gitignore.
    • $ sudo dnf install gcc-c++
    • $ g++ <name>.cc -o <name>.out
    • $ ./<name>.out <args>
  • Java:
    • $ sudo dnf install java
    • $ javac <Name>.java
    • $ java <Name> <args>
  • JavaScript:
    • $ sudo dnf install nodejs
    • $ node <name>.js <args>
  • Kotlin:
    • $ sudo snap install --classic kotlin
    • $ kotlinc -script <name>.kts <args>
  • Objective-C:
    • Don't bother...it's a huge pain....
  • PHP
    • $ sudo dnf install php
    • $ php <name>.php <args>
  • Python:
    • $ sudo dnf install python3
    • $ python3 <name>.py <args>
  • Ruby:
    • $ sudo dnf install ruby
    • $ ruby <name>.rb <args>

GNU GPL v3+

I did not add the license to the top of each file, because I wanted the files to be small and quickly viewable (like scripts). However, every file in this repo is under this license, so do not be afraid to use any of the code here in a project that is compatible with this license.

codewars (https://github.com/esotericpig/codewars)
Copyright (c) 2018-2021 Bradley Whited

codewars is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

codewars is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with codewars. If not, see http://www.gnu.org/licenses/.

About

👾🎒:neckbeard: My codewars solutions: Ruby, Java, Python, C++, JavaScript, Crystal, Kotlin, CoffeeScript, PHP, Objective-C.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages