Skip to content

AlexandrAnatoliev/project-euler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Project Euler

A project designed to help developers learn and practice Java

EN RU Version 0.1.3 Stars Forks PRs Welcome First Contributors GitHub repo size


Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient solutions, the use of a computer and programming skills will be required to solve most problems.

Practice Java coding by solving Project Euler problems and make your first open-source contribution through a pull request!

Author: Alexandr Anatoliev

GitHub: AlexandrAnatoliev


Table of Contents


Setup Instructions

  1. Fork this repository by clicking on the "Fork" button at the top-right corner of this page. This creates a copy of the repository in your GitHub account.

  1. Clone your forked repository by clicking the "Code" button:

That will open this small window:


After that you can copy and paste the URL to your local machine with the command:

git clone https://github.com/<your-username>/project-euler.git
  1. Navigate to your project folder:
cd project-euler
  1. Add a reference to the original repository for future updates:
git remote add upstream https://github.com/AlexandrAnatoliev/project-euler.git

(Remember to keep here the original repository URL, not your forked one, so the username in this needs to be AlexandrAnatoliev, not your own username.)

  1. Check the remotes for your local repository:
git remote -v

You should now see the origin and upstream remotes listed.

origin  https://github.com/<your-username>/project-euler.git (fetch)
origin  https://github.com/<your-username>/project-euler.git (push)
upstream        https://github.com/AlexandrAnatoliev/project-euler.git (fetch)
upstream        https://github.com/AlexandrAnatoliev/project-euler.git (push)
  1. Pull from the upstream repository to your master branch to keep it in sync with the main project:
git pull upstream master
  1. Create a new branch with the command:
git switch -c fix-issue

Now you are ready to start working on the issues! Remember every once in a while to pull from the upstream repository to keep your local repository up to date with the main project.

Note: I recommend to always create new branch with each Issue you solve! Otherwise the pull requests will get too large and there could be possible merge conflicts.


Problems

Project Euler consists of over 800 problems with varying difficulty. You can choose which problem you want to work on and solve. You can also choose to solve multiple problems if you like. Just remember to create a new branch for each problem you solve.

List of Problems:

  1. Multiples of 3 or 5

First, select the problem you want to solve and open the Problem directory:

project-euler 
├── Problem1/
│   └── README.md
├── Problem2/
│   └── README.md
├── Problem3/
│   └── README.md
└── README.md

Go to the README file of the selected problem to get more info about the issue.

Create directory for your solution in format:

Solution[problem number]-[your github nickname]/

For example:

project-euler 
├── Problem1/
│   ├── Solution1-User1/
│   ├── Solution1-Username2/
│   ├── Solution1-IvanIvanov/
│   │     ^
│   │     └── directory for your solution
│   └── README.md
├── Problem2/
│   ├── Solution2-User1/
│   └── README.md
└── README.md

After that you are ready to start solving!

Add your source files inside (Adding README.md is appreciated)

Please keep the repository organized by following these formats:

Solution1-YourGithubName/
├── Main.java       // Your source code
└── README.md       // (Optional) Short description or usage guide 

Or (some classes):

Solution1-YourGithubName/
├── src/           // Your source code
│   ├── Class1.java
│   ├── Class2.java
│   └── Main.java
└── README.md      

Or (add tests):

Solution1-YourGithubName/
├── src/           
│   ├── main/           // Your source code
│   │   ├── Class1.java
│   │   ├── Class2.java
│   │   └── Main.java
│   └── test/           // (Optional) tests 
│       ├── Class1Test.java
│       ├── Class2Test.java
│       └── MainTest.java
└── README.md      

Note: Avoid unnecessary files (no compiled binaries or IDE metadata) and make sure your solution application runs properly.

All valid solutions will be reviewed and merged.

Note: You don't have to ask for permission to start solving the issue or get assigned, since these issues are supposed to always be open for new contributors. You can just simply start working on the issue right away! Remember that in real world issues you would usually need to ask to get assigned to certain issue to prevent multiple people from working on the same issue at the same time, which would result in some contributors wasting their time.


Submitting Your Changes

Once you've made the necessary changes requested in the problem, you're ready to submit your changes!

  1. Stage your changes with the command:
git add files-that-you-changed
  1. Commit your changes with the command:
git commit -m "Fixed issue"
  1. Push your changes to your forked repository with the command:
git push origin fix-issue

Once you've pushed your changes to GitHub, you're ready to create a pull request. Go to your forked repository on GitHub.

  • You should see message "fix-issue had recent pushes" (or whatever your branch name is) and button "Compare & pull request" next to it.

  • Click the "Compare & pull request" button to proceed to the pull request page of the original project-euler repository.

  • Fill in the title and description boxes with details about the problem and how you got it to work. You can also add some additional information such as screenshots, if you want.

  • Finally, click "Create pull request" to finish creating the pull request.

Congratulations on making your first open source contribution on GitHub!

Sit back and wait for feedback on the pull request. If everything is fine, you should get the pull request merged. If not, you will be requested to make changes to your code.

Remember to wait for me to review your pull request, do not close it yourself. If you are asked to make changes, you can do so by committing them to the same branch, there is no need to close the current Pull Request and open a new one.


Influences

This project was inspired by a number of fantastic resources designed to help newcomers make their first contributions to open source. In particular, I would like to acknowledge:

  • Fork, Commit, Merge: A project designed to help you familiarize yourself with the open source contribution workflow on GitHub, as well as to help you learn the basics of programming with different languages, libraries and frameworks.

  • Polyglot-Calculators: Polyglot-Calculators is a community-driven, modern hybrid project that showcases how mathematical calculators and algorithms are implemented across different programming languages.

I highly recommend checking out these projects if you want to learn more about contributing to open source!


Contact

For any queries, feel free to open an issue, write to Discussions or reach out to me at per-1986@list.ru.


Requirements

  • Java installed

List of Contributors

Massive thanks to all the fine individuals who contributed to this project!


Добро пожаловать на Project Euler

Проект, помогающий изучить и попрактиковать конструкции языка Java

EN RU Version 0.1.3 Stars Forks PRs Welcome First Contributors GitHub repo size


Проект Эйлер — это серия сложных математических и вычислительных задач, для решения которых недостаточно одних только математических знаний. Хотя математика поможет находить изящные решения, большинство задач потребуют навыков программирования для их практической реализации.

Этот репозиторий предоставляет уникальную возможность:

  • Попрактиковаться в решении задач Project Euler на Java
  • Поучаствовать в реальном open-source проекте
  • Создать свой первый пул-реквест
  • Author: Alexandr Anatoliev

    GitHub: AlexandrAnatoliev


    Навигация


    Инструкции по Установке

    1. Сделайте "форк" этого репозитория нажатием кнопки "Fork" в правом верхнем углу страницы. Это создаст копию ркпозитория на Вашем GitHub аккаунте.

    2.Клонируйте Ваш "форкнутый" репозиторий нажатием кнопки "Code":


    Откроется маленькое окно:


    Скопируйте из него URL и выполните на своем компьютере команду:

    git clone https://github.com/<your-username>/project-euler.git
    1. Перейдите в папку с проектом:
    cd project-euler
    1. Добавьте ссылку на оригинальный репозиторий для будущих обновлений:
    git remote add upstream https://github.com/AlexandrAnatoliev/project-euler.git

    (Напомню, здесь должен быть URL оригинального репозитория, а не "форкнутого" Вами, так что username в нем должно быть AlexandrAnatoliev, а не Ваш собственный username.)

    1. Проверьте ремоуты для своего репозитория:
    git remote -v

    Вы должны увидеть origin и upstream ремоуты:

    origin  https://github.com/<your-username>/project-euler.git (fetch)
    origin  https://github.com/<your-username>/project-euler.git (push)
    upstream        https://github.com/AlexandrAnatoliev/project-euler.git (fetch)
    upstream        https://github.com/AlexandrAnatoliev/project-euler.git (push)
    
    1. Выполните pull из upstream репозитория в Вашу master ветку, чтобы синхронизировать ее с основным проектом:
    git pull upstream master
    1. Создайте новую ветку командой:
    git switch -c fix-issue

    Сейчас Вы готовы начать работать с issue! Помните, каждый раз сначала делать pull из upstream репозитория, чтобы держать содержимое Вашего локального репозитория в соответствии с главным проектом.

    Примечание: Рекомендую всегда создавать новую ветвь для каждого issue, который Вы выполняете! Иначе pull request будут слишком большими и возможно аозникнут конфликты слияния.


    Задачи

    Проект Эйлер содержит более 800 различных задач различной трудности. Вы можете выбрать любую задачу, которую Вы хотите. Вы можете также выбрать и решить несколько задач. Только не забывайте создавать новую ветвь для каждой из них.

    Список задач:

    1. Числа, кратные 3 или 5

    Сначала, выберите задачу, которую Вы хотите решать и откройте ее директорию:

    project-euler 
    ├── Problem1/
    │   └── README.md
    ├── Problem2/
    │   └── README.md
    ├── Problem3/
    │   └── README.md
    └── README.md
    

    Перейдите в README файл выбранной задачи, чтобы получить информацию об ее сути.

    Создайте директорию для Вашего решения в формате:

    Solution[номер задачи]-[Ваш github nickname]/
    

    Например:

    project-euler 
    ├── Problem1/
    │   ├── Solution1-User1/
    │   ├── Solution1-Username2/
    │   ├── Solution1-IvanIvanov/
    │   │     ^
    │   │     └── директория для Вашего решения
    │   └── README.md
    ├── Problem2/
    │   ├── Solution2-User1/
    │   └── README.md
    └── README.md
    

    После этого Вы готовы решать задачу!

    Добавьте файлы с исходным кодом в Вашу директорию (Наличие README приветствуется)

    Пожалуйста, организуйте репозиторий придерживаясь одного из следующих форматов:

    Solution1-YourGithubName/
    ├── Main.java       // Ваш исходный код
    └── README.md       // (Опционально) короткое описание или гайд по использованию 
    

    Если код состоит из нескольких классов:

    Solution1-YourGithubName/
    ├── src/           // Ваш исходный код
    │   ├── Class1.java
    │   ├── Class2.java
    │   └── Main.java
    └── README.md      
    

    Если есть тесты:

    Solution1-YourGithubName/
    ├── src/           
    │   ├── main/           // Ваш исходный код
    │   │   ├── Class1.java
    │   │   ├── Class2.java
    │   │   └── Main.java
    │   └── test/           // (Опционально) тесты 
    │       ├── Class1Test.java
    │       ├── Class2Test.java
    │       └── MainTest.java
    └── README.md      
    

    Примечание: Избегайте лишних файлов (бинарные файлы или метаданные IDE) и проверьте что Ваша программа работает корректно.

    Все корректные решения будут добавлены после ревью.

    Примечание: Вам не нужно спрашивать разрешения начать решать задачу, предложенную в issue, т.к. в этом проекте все issue открыты для новых контрибьютеров. Можно сразу же начинать работать с issue прямо сейчас! Однако помните, что на большинстве проектов Вам необходимо спрашивать разрешение прежде чем начать работать с issue. Это необходимо чтобы несколько человек не начали работать над одним и тем же issue одновременно, и соответственно потратили свое время...


    Отправка Ваших изменений

    После того как Вы решили задачу, Вы готовы отправить изменения!

    1. Добавьте Ваши изменения в отслеживание:
    git add файлы-которые-вы-изменили
    1. Сделайте коммит:
    git commit -m "Fixed issue"
    1. Отправить изменения в Ваш "форкнутый" репозиторий:
    git push origin fix-issue

    После того как Вы отправили Ваши изменения на GitHub, Вы готовы создать pull request. Перейдите на Ваш "форк" репозитория на GitHub.

    • Вы увидите надпись "fix-issue had recent pushes" (или как Ваша ветка называется) и кнопку "Compare & pull request" на ней.

    • Нажмите кнопку "Compare & pull request" и перейдете на страницу pull request оригинального репозитория прректа project-euler.

    • Заполните поля title и description подробностямм о задаче и Вашем ее решении. Вы можете также добавить иную информацию, такую как скриншоты, если хотите.

    • В конце нажмите кнопку "Create pull request" чтобы закончить создание pull request.

    Поздравляю, Вы сделали свой первый вклад в open source на GitHub!

    Можете расслабиться и подождать пока не сделают ревью Вашего кода. Если все хорошо, Ваш pull request вольют в основную ветку. Если нет, Вам будет предложено внести изменения в Ваш код.

    Помните, что нужно подождать ревью Вашего pull request, не закрывайте его сами. Если Вас просят сделать изменения, Вы можете коммититить их в ну же самую ветвь, не нужно закрывать текущий pull request и открывать новый.


    Похожие проекты

    Этот проект вдохновлялся несколькими хорошими проектами, созданными с целью помочь новичкам сделать свой первый вклад в open source.

    • Fork, Commit, Merge: Проект созданный чтобы помочь Вам познакомиться с процессом вклада в open source на GitHub, а также помочь освоить базы программирования на различных языках, библиотеках и фреймворках.

    • Polyglot-Calculators: Polyglot-Calculators управляемый сообществом современный гибридный проект, который демонстрирует, как математические калькуляторы и алгоритмы реализуются на разных языках программирования.

    Я очень рекомендую посмотреть эти проекты!


    Контакты

    Столкнувшись с затруднениями, не стесняйтесь открыть issue, написать в Discussions или мне на почту per-1986@list.ru.


    Требования

    • Установленная Java

    Список Контрибьютеров

    Огромное спасибо всем, кто контрибьютил в этот проект!

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages