Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added affine-cipher #123

Closed
wants to merge 15 commits into from
Closed

Conversation

tintinthong
Copy link
Contributor

README can be improved. Need feedback if possible.

Put difficulty as 5 since this question is math heavy. Do not know whether scale is 1-10 (i meant for this scale) or 1-5. All other questions below difficulty of 5 so can't judge.

Here is the [problem specs] (https://github.com/exercism/problem-specifications/blob/master/exercises/affine-cipher/description.md)

@lintr-bot
Copy link

exercises/affine-cipher/example.R:17:1: style: lines should not be more than 80 characters.

return(paste(letters[ ((a * (match(strsplit(tolower(gsub(" ", "", message)), "")[[1]], letters) - 1) + b) %% m) + 1], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:48:1: style: lines should not be more than 80 characters.

return(paste(letters[((mmi(a, m) * ((match(strsplit(gsub(" ", "", encryption), "")[[1]], letters) - 1) - b)) %% m) + 1], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/test_affine-cipher.R:24:1: style: lines should not be more than 80 characters.

​  expect_identical(decrypt("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13), "thequickbrownfoxjumpsoverthelazydog")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/test_affine-cipher.R:29:1: style: lines should not be more than 80 characters.

​  expect_identical(decrypt("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13), "thequickbrownfoxjumpsoverthelazydog")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2 similar comments
@lintr-bot
Copy link

exercises/affine-cipher/example.R:17:1: style: lines should not be more than 80 characters.

return(paste(letters[ ((a * (match(strsplit(tolower(gsub(" ", "", message)), "")[[1]], letters) - 1) + b) %% m) + 1], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:48:1: style: lines should not be more than 80 characters.

return(paste(letters[((mmi(a, m) * ((match(strsplit(gsub(" ", "", encryption), "")[[1]], letters) - 1) - b)) %% m) + 1], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/test_affine-cipher.R:24:1: style: lines should not be more than 80 characters.

​  expect_identical(decrypt("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13), "thequickbrownfoxjumpsoverthelazydog")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/test_affine-cipher.R:29:1: style: lines should not be more than 80 characters.

​  expect_identical(decrypt("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13), "thequickbrownfoxjumpsoverthelazydog")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@lintr-bot
Copy link

exercises/affine-cipher/example.R:17:1: style: lines should not be more than 80 characters.

return(paste(letters[ ((a * (match(strsplit(tolower(gsub(" ", "", message)), "")[[1]], letters) - 1) + b) %% m) + 1], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:48:1: style: lines should not be more than 80 characters.

return(paste(letters[((mmi(a, m) * ((match(strsplit(gsub(" ", "", encryption), "")[[1]], letters) - 1) - b)) %% m) + 1], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/test_affine-cipher.R:24:1: style: lines should not be more than 80 characters.

​  expect_identical(decrypt("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13), "thequickbrownfoxjumpsoverthelazydog")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/test_affine-cipher.R:29:1: style: lines should not be more than 80 characters.

​  expect_identical(decrypt("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13), "thequickbrownfoxjumpsoverthelazydog")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@katrinleinweber
Copy link
Contributor

Hello again and thanks for another contribution :-)

As you see, a lot of left-over commits from #122 are included here, so let's first remove 73af394 to 1fc4edb. Assuming your git remote --verbose contains origin https://github.com/tintinthong/r and upstream https://github.com/exercism/r (fetch), please try in your command line:

  1. git fetch --all to see the existing updates on GitHub
  2. git checkout -b affine-cipher-2 upstream/master to start a fresh branch for this PR
  3. git cherry-pick 5803eb5 && git cherry-pick 1865352 to transfer this PR's main commits
  4. git push --force-with-lease -u origin affine-cipher to overwrite this PR's "dirty" branch

If you only edited in GitHub's web interface so far, please see the links under https://github.com/exercism/r#writing-a-pull-request.

If you're unsure about that, feel free ask me about any of these steps or give me the green light to clean up.

@tintinthong
Copy link
Contributor Author

Hello again and thanks for another contribution :-)

As you see, a lot of left-over commits from #122 are included here, so let's first remove 73af394 to 1fc4edb. Assuming your git remote --verbose contains origin https://github.com/tintinthong/r and upstream https://github.com/exercism/r (fetch), please try in your command line:

  1. git fetch --all to see the existing updates on GitHub
  2. git checkout -b affine-cipher-2 upstream/master to start a fresh branch for this PR
  3. git cherry-pick 5803eb5 && git cherry-pick 1865352 to transfer this PR's main commits
  4. git push --force-with-lease -u origin affine-cipher to overwrite this PR's "dirty" branch

If you only edited in GitHub's web interface so far, please see the links under https://github.com/exercism/r#writing-a-pull-request.

If you're unsure about that, feel free ask me about any of these steps or give me the green light to clean up.

Hi sorry. have been busy with work. I will try to solve it 😬

@tintinthong tintinthong mentioned this pull request Aug 6, 2019
@tintinthong
Copy link
Contributor Author

Hello again and thanks for another contribution :-)

As you see, a lot of left-over commits from #122 are included here, so let's first remove 73af394 to 1fc4edb. Assuming your git remote --verbose contains origin https://github.com/tintinthong/r and upstream https://github.com/exercism/r (fetch), please try in your command line:

  1. git fetch --all to see the existing updates on GitHub
  2. git checkout -b affine-cipher-2 upstream/master to start a fresh branch for this PR
  3. git cherry-pick 5803eb5 && git cherry-pick 1865352 to transfer this PR's main commits
  4. git push --force-with-lease -u origin affine-cipher to overwrite this PR's "dirty" branch

If you only edited in GitHub's web interface so far, please see the links under https://github.com/exercism/r#writing-a-pull-request.

If you're unsure about that, feel free ask me about any of these steps or give me the green light to clean up.

@katrinleinweber I just made a new pull request. If no problems I'd like to close this pull request and work on my new branch affin-cipher-fix

@tintinthong tintinthong closed this Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants