PlummersSoftwareLLC / Primes

Prime Number Projects in C#/C++/Python
https://plummerssoftwarellc.github.io/PrimeView/
2.44k stars 575 forks source link

Fix some incorrect assignments with BOOL version and add BITS version #881

Closed rzuckerm closed 1 year ago

rzuckerm commented 1 year ago

Description

In the original implementation that uses BOOL, there were some = operators that should have been :=. An equivalent implementation uses the BITS data type has been added for comparison. This is 10x slower, but I thought it would be interesting to have. If this should be made a separate solution, please let me know.

Contributing requirements

rbergen commented 1 year ago

Really cool to have a base algorithm, faithful, 1 bit solution in this language! That means Algol will now be one of the languages with a solution in the "core set"; that being the ones that match the characteristics of Dave's original 3 implementations that started this whole project.

rbergen commented 1 year ago

Hadolint found one issue in your Dockerfile (consecutive RUNs due to the added build for the BITS version), as indicated in the changed files. If you can please fix this then I think we're good to go,

rzuckerm commented 1 year ago

Hadolint found one issue in your Dockerfile (consecutive RUNs due to the added build for the BITS version), as indicated in the changed files.

A script that a developer can run locally to do this linting would be nice to have. The docker run command is rather cumbersome.

rbergen commented 1 year ago

Personally I think it's a copy/paste from the contributing guidelines, with two pretty straightforward edits. But nothing is stopping you from opening a PR that adds a script like the one you suggest in the tools directory, that uses the docker run in a parameterized fashion. :) I would not like to extend the list of software prerequisites for this, or (worse) force a local install of Hadolint.

rzuckerm commented 1 year ago

Personally I think it's a copy/paste from the contributing guidelines, with two pretty straightforward edits. But nothing is stopping you from opening a PR that adds a script like the one you suggest in the tools directory, that uses the docker run in a parameterized fashion. :) I would not like to extend the list of software prerequisites for this, or (worse) force a local install of Hadolint.

The intent is to just add a simple bash script that you can give two params: language and solution number. I'll do a PR for this later.

rbergen commented 1 year ago

The intent is to just add a simple bash script that you can give two params: language and solution number. I'll do a PR for this later.

I understand. If you do put a PR together, please include an updated version of CONTRIBUTING.md that replaces the docker run with the use of your script.

In the mean time, I will merge this one.