Giter Club home page Giter Club logo

nim's Introduction

The Algorithms – Nim 

Gitpod Ready-to-Code Contributions Welcome Repo size
Discord chat Gitter chat Matrix room

Algorithms collection implemented in Nim - for education

Implementations are for learning purposes only. They may be less efficient than the implementations in the Nim standard library or Nimble packages. Use them at your discretion.

Getting Started

Read through our Contribution Guidelines before you contribute.

List of Algorithms

See our directory for easier navigation and a better overview of the project.

You can also browse the implementations on the website.

Community Channels

We are on Discord and Gitter/Matrix!

Community channels are a great way for you to ask questions and get help. Please join us!

nim's People

Contributors

anupkumarpanwar avatar archargelod avatar ayushsgithub avatar dlesnoff avatar panquesito7 avatar satinwukerorig avatar vil02 avatar zoomrmc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nim's Issues

[BUG] Incorrect link to the `DIRECTORY.md` file

Description

The contributing guidelines link directly to the DIRECTORY.md file, to make it easier for other people to find the algorithm list.
However, the given link is incorrect and is not working, which should be immediately fixed.

Steps to contribute

  1. Fork the repository here.
  2. Create a new branch named fix_directory_link.
  3. Open the CONTRIBUTING.md file.
  4. Go to line 41, and replace directory.md with DIRECTORY.md.
  5. There's another instance of the same. Go to line 52 and replace directory.md with DIRECTORY.md.
  6. Commit and push your changes.
  7. Create a pull request to compare your changes.
  8. You're done now! 🎉 You just have to wait until the maintainers review your PR.

If you need any help with this, let us know about it. 🙂

Additional information

This is a good first issue. Please leave it open to first-time contributors and beginners.

CI failure: linear search algorithm, string array and recursive algorithm.

Currently, CI fails due to the linear search algorithm.
There is an issue with the recursive algorithm for string arrays.

proc recursiveLinearSearch*[T](arr: openArray[T], key: T, idx: Nat = arr.low.Nat): OptNat=
  # Recursion is another method for linear search.
  # Recursive calls replace the for loop.

  # `none(Natural)` is returned when the array is traversed completely
  # and no key is matched, or when `arr` is empty.
  if idx > arr.high:
    return none(Natural)
  if arr[idx] == key:
    return some(idx)
  echo idx, " ", arr[idx], " ", key
  recursiveLinearSearch(arr, key, idx + 1)

for the test:

var arr = ["0", "c", "a", "u", "5", "7"]
check recursiveLinearSearch(arr, "5") == some(Natural(4))

outputs:

0  5
1  5
2  5
3  5
4  5
5  5

Expected output:

0 0 5
1 c 5
2 a 5
3 u 5

We could maybe fix it by converting the example test array to a sequence:

var arr = @["0", "c", "a", "u", "5", "7"]

Change the About Section

I do not like very much the "All algorithms implemented in Nim" description. I prefer something along the lines of:
"Collection of various algorithms implemented in Nim for educational purposes." similar to the C++ repository description which is more explicit and less conceited.

We could also add a link to the documentation of the project, which will be the object of a future issue.

We might want to add more tags to the description. We can already add educational, interview-questions and more like mathematics, string, as we add more code examples.

[BUG] Wrong label link

Description

In the README.md file, there's a badge that links to the contributing guidelines.
However, that link is pointing to the master branch, which doesn't exist. It still redirects you, but I still think we should update that to use the correct branch name.

Steps to contribute

  1. Fork the repository here.
  2. Create a new branch named fix_badge_link.
  3. Open the README.md file.
  4. At the top of the file, you'll see a Markdown link with the text Contributions Welcome. Update the link to point to the main branch instead of the master branch.
  5. Commit and push your changes.
  6. Create a pull request to compare your changes.
  7. You're done now! 🎉 You have to wait until the maintainers review your PR.

If you need any help, let us know! 🙂

Additional information

This is a good first issue. Please leave it open to first-time contributors and beginners.

Issue with the DIRECTORY.md script

@ZoomRmc proposed a script to automatically fetch the names of the different algorithms implementations.
This script does not detect the catalan_numbers.nim file in the dynamic programming directory.
I would accept any PR that partially fix these algorithm's detection issues.

chore: move compiler defaults from `nim.cfg` to `config.nims`

At this moment, in some cases setting the default gc/mm setting for the compiler results in a compilation error.
The workaround for this is moving the setting to the nim.cfg file. Having an additional configuration file is not great, so as soon as the fix for the bug lands in stable the setting should be moved back to the config.nims and nim.cfg should be removed.

This is a PR that sould have fixed the issue: nim-lang/Nim#19455. Not sure why we're still hitting it.

Looking for maintainers!

Description

The repository was recently created, so we need people that are proficient and experienced in the Nim programming language.
Anyone interested, feel free to comment here and contribute to our repository.

Thanks for your interest! 🙂

linear_search failing tests: upstream bug with openArray to `array[string]`?

Currently the testcase "Search in a string array matching with a string matching value" is failing, returning None, due to openArray of arr resolving to array of empty strings, inside the recursive search it's ["", "", "", "", "", ""].

Changing the arr to const or to a variable seq (instead of array) fixes execution.

I'll try to investigate and post an upstream issue.

[BUG] Update `DIRECTORY.md` file (semi-)automatically

Description

There's a script to build the DIRECTORY.md file. However, there's no workflow or anything that creates it automatically.
The users won't be able to see a list of algorithms. There's also a broken link in the readme.

I propose to create a GitHub Actions workflow to build it automatically on every push (not pull_request as this could mess up the PR branch) if there are any changes.
With protected branches, there's no way to push directly, but a pull request can be created by GitHub Actions, and then reviewed by the maintainers.

What do you think about this? 🙂

CI: The `DIRECTORY.md` CI action does nothing

@Panquesito7 previously added a CI action to open a pull request each time a contribution is made, to update the directory.md file.
It appears to do nothing right now.

I guess that the newly created DIRECTORY.md file is not detected when added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.