r icon indicating copy to clipboard operation
r copied to clipboard

Affin cipher fix

Open tintinthong opened this issue 5 years ago • 24 comments

This is my fix to the previous pull-request on #123.

Using GitKraken as GUI tool for Git, created new branch affin-cipher-fix. The problem was that my previous branch affine-cipher had excessive historical commits that was squashed on the upstream remote master(exercism/r/master). It is a mouthful and confusing but I basically, reset to the commit 73af394, pulled canges from upstream remote master and cherry picked my pull request commits 0ba2c4 and 950598 on affine-cipher branch. Hope I didn't change any history that has any conflicts.

In this new commit, I made code more readable by breaking it up into lines (also because lintr bot also said my line had too many characters).

Once everything is fine. I will do a squash myself.

tintinthong avatar Aug 06 '19 19:08 tintinthong

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

​  parsedMessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:16:3: style: Variable and function names should be all lowercase.

​  parsedMessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
  ^~~~~~~~~~~~~

exercises/affine-cipher/example.R:17:25: style: Variable and function names should be all lowercase.

​  splitList <- strsplit(parsedMessage, "")[[1]] # list of letters
                        ^~~~~~~~~~~~~

exercises/affine-cipher/example.R:51:3: style: Variable and function names should be all lowercase.

​  parsedEncryption <- gsub(" ", "", encryption) # removed whitespace
  ^~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:52:25: style: Variable and function names should be all lowercase.

​  splitList <- strsplit(parsedEncryption, "")[[1]] # list of letters
                        ^~~~~~~~~~~~~~~~

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 avatar Aug 06 '19 19:08 lintr-bot

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

​  parsedMessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:16:3: style: Variable and function names should be all lowercase.

​  parsedMessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
  ^~~~~~~~~~~~~

exercises/affine-cipher/example.R:17:25: style: Variable and function names should be all lowercase.

​  splitList <- strsplit(parsedMessage, "")[[1]] # list of letters
                        ^~~~~~~~~~~~~

exercises/affine-cipher/example.R:51:3: style: Variable and function names should be all lowercase.

​  parsedEncryption <- gsub(" ", "", encryption) # removed whitespace
  ^~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:52:25: style: Variable and function names should be all lowercase.

​  splitList <- strsplit(parsedEncryption, "")[[1]] # list of letters
                        ^~~~~~~~~~~~~~~~

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 avatar Aug 06 '19 19:08 lintr-bot

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

​  parsedMessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:16:3: style: Variable and function names should be all lowercase.

​  parsedMessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
  ^~~~~~~~~~~~~

exercises/affine-cipher/example.R:17:25: style: Variable and function names should be all lowercase.

​  splitList <- strsplit(parsedMessage, "")[[1]] # list of letters
                        ^~~~~~~~~~~~~

exercises/affine-cipher/example.R:51:3: style: Variable and function names should be all lowercase.

​  parsedEncryption <- gsub(" ", "", encryption) # removed whitespace
  ^~~~~~~~~~~~~~~~

exercises/affine-cipher/example.R:52:25: style: Variable and function names should be all lowercase.

​  splitList <- strsplit(parsedEncryption, "")[[1]] # list of letters
                        ^~~~~~~~~~~~~~~~

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 avatar Aug 06 '19 19:08 lintr-bot

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

​  parsedmessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lintr-bot avatar Aug 06 '19 19:08 lintr-bot

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

​  parsedmessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lintr-bot avatar Aug 06 '19 19:08 lintr-bot

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

​  parsedmessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lintr-bot avatar Aug 06 '19 19:08 lintr-bot

Nicely done :-) I'll review on the weekend.

katrinleinweber avatar Aug 08 '19 18:08 katrinleinweber

exercises/affine-cipher/affine-cipher.R:5:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:10:1: style: Variable and function names should be all lowercase.

​lookupIndex<-function(normalisedtext){
^~~~~~~~~~~

exercises/affine-cipher/affine-cipher.R:10:12: style: Put spaces around all infix operators.

​lookupIndex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:41:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/affine-cipher.R:41:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/affine-cipher.R:41:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/affine-cipher.R:41:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/affine-cipher.R:45:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/affine-cipher.R:46:4: style: Put spaces around all infix operators.

​  x<-lookupIndex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/affine-cipher.R:46:6: style: Variable and function names should be all lowercase.

​  x<-lookupIndex(normalisedplaintext)
     ^~~~~~~~~~~

exercises/affine-cipher/affine-cipher.R:62:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/affine-cipher.R:63:4: style: Put spaces around all infix operators.

​  y<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/affine-cipher.R:63:6: style: Variable and function names should be all lowercase.

​  y<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

exercises/affine-cipher/example.R:5:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:10:1: style: Variable and function names should be all lowercase.

​lookupIndex<-function(normalisedtext){
^~~~~~~~~~~

exercises/affine-cipher/example.R:10:12: style: Put spaces around all infix operators.

​lookupIndex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:41:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:41:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:41:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:41:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:45:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  x<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/example.R:46:6: style: Variable and function names should be all lowercase.

​  x<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

exercises/affine-cipher/example.R:62:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(plaintext)
                     ~^~~

exercises/affine-cipher/example.R:63:4: style: Put spaces around all infix operators.

​  y<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/example.R:63:6: style: Variable and function names should be all lowercase.

​  y<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

lintr-bot avatar Aug 12 '19 06:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:5:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:10:1: style: Variable and function names should be all lowercase.

​lookupIndex<-function(normalisedtext){
^~~~~~~~~~~

exercises/affine-cipher/affine-cipher.R:10:12: style: Put spaces around all infix operators.

​lookupIndex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:41:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/affine-cipher.R:41:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/affine-cipher.R:41:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/affine-cipher.R:41:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/affine-cipher.R:45:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/affine-cipher.R:46:4: style: Put spaces around all infix operators.

​  x<-lookupIndex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/affine-cipher.R:46:6: style: Variable and function names should be all lowercase.

​  x<-lookupIndex(normalisedplaintext)
     ^~~~~~~~~~~

exercises/affine-cipher/affine-cipher.R:62:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/affine-cipher.R:63:4: style: Put spaces around all infix operators.

​  y<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/affine-cipher.R:63:6: style: Variable and function names should be all lowercase.

​  y<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

exercises/affine-cipher/example.R:5:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:10:1: style: Variable and function names should be all lowercase.

​lookupIndex<-function(normalisedtext){
^~~~~~~~~~~

exercises/affine-cipher/example.R:10:12: style: Put spaces around all infix operators.

​lookupIndex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:41:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:41:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:41:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:41:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:45:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  x<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/example.R:46:6: style: Variable and function names should be all lowercase.

​  x<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

exercises/affine-cipher/example.R:62:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(plaintext)
                     ~^~~

exercises/affine-cipher/example.R:63:4: style: Put spaces around all infix operators.

​  y<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/example.R:63:6: style: Variable and function names should be all lowercase.

​  y<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

lintr-bot avatar Aug 12 '19 06:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:5:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:10:1: style: Variable and function names should be all lowercase.

​lookupIndex<-function(normalisedtext){
^~~~~~~~~~~

exercises/affine-cipher/affine-cipher.R:10:12: style: Put spaces around all infix operators.

​lookupIndex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:41:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/affine-cipher.R:41:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/affine-cipher.R:41:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/affine-cipher.R:41:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/affine-cipher.R:45:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/affine-cipher.R:46:4: style: Put spaces around all infix operators.

​  x<-lookupIndex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/affine-cipher.R:46:6: style: Variable and function names should be all lowercase.

​  x<-lookupIndex(normalisedplaintext)
     ^~~~~~~~~~~

exercises/affine-cipher/affine-cipher.R:62:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/affine-cipher.R:63:4: style: Put spaces around all infix operators.

​  y<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/affine-cipher.R:63:6: style: Variable and function names should be all lowercase.

​  y<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

exercises/affine-cipher/example.R:5:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:10:1: style: Variable and function names should be all lowercase.

​lookupIndex<-function(normalisedtext){
^~~~~~~~~~~

exercises/affine-cipher/example.R:10:12: style: Put spaces around all infix operators.

​lookupIndex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:41:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:41:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:41:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:41:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:45:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  x<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/example.R:46:6: style: Variable and function names should be all lowercase.

​  x<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

exercises/affine-cipher/example.R:62:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(plaintext)
                     ~^~~

exercises/affine-cipher/example.R:63:4: style: Put spaces around all infix operators.

​  y<-lookupIndex(normalisedencryption)
  ~^~~

exercises/affine-cipher/example.R:63:6: style: Variable and function names should be all lowercase.

​  y<-lookupIndex(normalisedencryption)
     ^~~~~~~~~~~

lintr-bot avatar Aug 12 '19 06:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:4:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:7:4: style: Put spaces around all infix operators.

​gcd<-function(x,y){
  ~^~~

exercises/affine-cipher/affine-cipher.R:7:17: style: Commas should always have a space after.

​gcd<-function(x,y){
                ^

exercises/affine-cipher/affine-cipher.R:10:4: style: Put spaces around all infix operators.

​mmi<-function(a,m){
  ~^~~

exercises/affine-cipher/affine-cipher.R:10:17: style: Commas should always have a space after.

​mmi<-function(a,m){
                ^

exercises/affine-cipher/affine-cipher.R:13:8: style: Put spaces around all infix operators.

​encrypt<-function(plaintext,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:13:29: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                            ^

exercises/affine-cipher/affine-cipher.R:13:31: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                              ^

exercises/affine-cipher/affine-cipher.R:16:8: style: Put spaces around all infix operators.

​decrypt<-function(encryption,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:16:30: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                             ^

exercises/affine-cipher/affine-cipher.R:16:32: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                               ^

exercises/affine-cipher/example.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:5:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:29:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:29:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:29:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:29:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:32:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:33:4: style: Put spaces around all infix operators.

​  x<-lookupindex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/example.R:45:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  y<-lookupindex(normalisedencryption)
  ~^~~

lintr-bot avatar Aug 12 '19 08:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:4:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:7:4: style: Put spaces around all infix operators.

​gcd<-function(x,y){
  ~^~~

exercises/affine-cipher/affine-cipher.R:7:17: style: Commas should always have a space after.

​gcd<-function(x,y){
                ^

exercises/affine-cipher/affine-cipher.R:10:4: style: Put spaces around all infix operators.

​mmi<-function(a,m){
  ~^~~

exercises/affine-cipher/affine-cipher.R:10:17: style: Commas should always have a space after.

​mmi<-function(a,m){
                ^

exercises/affine-cipher/affine-cipher.R:13:8: style: Put spaces around all infix operators.

​encrypt<-function(plaintext,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:13:29: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                            ^

exercises/affine-cipher/affine-cipher.R:13:31: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                              ^

exercises/affine-cipher/affine-cipher.R:16:8: style: Put spaces around all infix operators.

​decrypt<-function(encryption,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:16:30: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                             ^

exercises/affine-cipher/affine-cipher.R:16:32: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                               ^

exercises/affine-cipher/example.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:5:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:29:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:29:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:29:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:29:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:32:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:33:4: style: Put spaces around all infix operators.

​  x<-lookupindex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/example.R:45:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  y<-lookupindex(normalisedencryption)
  ~^~~

lintr-bot avatar Aug 12 '19 08:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:4:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:7:4: style: Put spaces around all infix operators.

​gcd<-function(x,y){
  ~^~~

exercises/affine-cipher/affine-cipher.R:7:17: style: Commas should always have a space after.

​gcd<-function(x,y){
                ^

exercises/affine-cipher/affine-cipher.R:10:4: style: Put spaces around all infix operators.

​mmi<-function(a,m){
  ~^~~

exercises/affine-cipher/affine-cipher.R:10:17: style: Commas should always have a space after.

​mmi<-function(a,m){
                ^

exercises/affine-cipher/affine-cipher.R:13:8: style: Put spaces around all infix operators.

​encrypt<-function(plaintext,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:13:29: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                            ^

exercises/affine-cipher/affine-cipher.R:13:31: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                              ^

exercises/affine-cipher/affine-cipher.R:16:8: style: Put spaces around all infix operators.

​decrypt<-function(encryption,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:16:30: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                             ^

exercises/affine-cipher/affine-cipher.R:16:32: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                               ^

exercises/affine-cipher/example.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:5:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:29:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:29:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:29:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:29:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:32:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:33:4: style: Put spaces around all infix operators.

​  x<-lookupindex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/example.R:45:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  y<-lookupindex(normalisedencryption)
  ~^~~

lintr-bot avatar Aug 12 '19 08:08 lintr-bot

@katrinleinweber I made all changes mentioned. I made affine cipher of difficulty 4 and unlocked_by prime-factors

tintinthong avatar Aug 12 '19 08:08 tintinthong

exercises/affine-cipher/affine-cipher.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:4:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:7:4: style: Put spaces around all infix operators.

​gcd<-function(x,y){
  ~^~~

exercises/affine-cipher/affine-cipher.R:7:17: style: Commas should always have a space after.

​gcd<-function(x,y){
                ^

exercises/affine-cipher/affine-cipher.R:10:4: style: Put spaces around all infix operators.

​mmi<-function(a,m){
  ~^~~

exercises/affine-cipher/affine-cipher.R:10:17: style: Commas should always have a space after.

​mmi<-function(a,m){
                ^

exercises/affine-cipher/affine-cipher.R:13:8: style: Put spaces around all infix operators.

​encrypt<-function(plaintext,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:13:29: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                            ^

exercises/affine-cipher/affine-cipher.R:13:31: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                              ^

exercises/affine-cipher/affine-cipher.R:16:8: style: Put spaces around all infix operators.

​decrypt<-function(encryption,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:16:30: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                             ^

exercises/affine-cipher/affine-cipher.R:16:32: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                               ^

exercises/affine-cipher/example.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:5:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:29:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:29:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:29:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:29:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:32:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:33:4: style: Put spaces around all infix operators.

​  x<-lookupindex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/example.R:45:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  y<-lookupindex(normalisedencryption)
  ~^~~

lintr-bot avatar Aug 12 '19 08:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:4:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:7:4: style: Put spaces around all infix operators.

​gcd<-function(x,y){
  ~^~~

exercises/affine-cipher/affine-cipher.R:7:17: style: Commas should always have a space after.

​gcd<-function(x,y){
                ^

exercises/affine-cipher/affine-cipher.R:10:4: style: Put spaces around all infix operators.

​mmi<-function(a,m){
  ~^~~

exercises/affine-cipher/affine-cipher.R:10:17: style: Commas should always have a space after.

​mmi<-function(a,m){
                ^

exercises/affine-cipher/affine-cipher.R:13:8: style: Put spaces around all infix operators.

​encrypt<-function(plaintext,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:13:29: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                            ^

exercises/affine-cipher/affine-cipher.R:13:31: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                              ^

exercises/affine-cipher/affine-cipher.R:16:8: style: Put spaces around all infix operators.

​decrypt<-function(encryption,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:16:30: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                             ^

exercises/affine-cipher/affine-cipher.R:16:32: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                               ^

exercises/affine-cipher/example.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:5:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:29:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:29:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:29:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:29:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:32:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:33:4: style: Put spaces around all infix operators.

​  x<-lookupindex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/example.R:45:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  y<-lookupindex(normalisedencryption)
  ~^~~

lintr-bot avatar Aug 12 '19 08:08 lintr-bot

exercises/affine-cipher/affine-cipher.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/affine-cipher.R:4:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/affine-cipher.R:7:4: style: Put spaces around all infix operators.

​gcd<-function(x,y){
  ~^~~

exercises/affine-cipher/affine-cipher.R:7:17: style: Commas should always have a space after.

​gcd<-function(x,y){
                ^

exercises/affine-cipher/affine-cipher.R:10:4: style: Put spaces around all infix operators.

​mmi<-function(a,m){
  ~^~~

exercises/affine-cipher/affine-cipher.R:10:17: style: Commas should always have a space after.

​mmi<-function(a,m){
                ^

exercises/affine-cipher/affine-cipher.R:13:8: style: Put spaces around all infix operators.

​encrypt<-function(plaintext,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:13:29: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                            ^

exercises/affine-cipher/affine-cipher.R:13:31: style: Commas should always have a space after.

​encrypt<-function(plaintext,a,b){
                              ^

exercises/affine-cipher/affine-cipher.R:16:8: style: Put spaces around all infix operators.

​decrypt<-function(encryption,a,b){
      ~^~~

exercises/affine-cipher/affine-cipher.R:16:30: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                             ^

exercises/affine-cipher/affine-cipher.R:16:32: style: Commas should always have a space after.

​decrypt<-function(encryption,a,b){
                               ^

exercises/affine-cipher/example.R:1:10: style: Put spaces around all infix operators.

​normalise<-function(text){
        ~^~~

exercises/affine-cipher/example.R:5:12: style: Put spaces around all infix operators.

​lookupindex<-function(normalisedtext){
          ~^~~

exercises/affine-cipher/example.R:29:21: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                    ^

exercises/affine-cipher/example.R:29:23: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                      ^

exercises/affine-cipher/example.R:29:33: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                ^

exercises/affine-cipher/example.R:29:35: style: Commas should always have a space after.

​    stop(paste('a=',a,' and m=',m,'is coprime'))
                                  ^

exercises/affine-cipher/example.R:32:22: style: Put spaces around all infix operators.

​  normalisedplaintext<-normalise(plaintext) 
                    ~^~~

exercises/affine-cipher/example.R:33:4: style: Put spaces around all infix operators.

​  x<-lookupindex(normalisedplaintext)
  ~^~~

exercises/affine-cipher/example.R:45:23: style: Put spaces around all infix operators.

​  normalisedencryption<-normalise(encryption)
                     ~^~~

exercises/affine-cipher/example.R:46:4: style: Put spaces around all infix operators.

​  y<-lookupindex(normalisedencryption)
  ~^~~

lintr-bot avatar Aug 12 '19 08:08 lintr-bot

Thanks for the updates :-) Aabout the linter bot: I forgot to point you to the styler addin for RStudio & its "Style active file" function before, sorry! It should prevent at least 90% of those minor issues.

katrinleinweber avatar Aug 12 '19 17:08 katrinleinweber

Thanks for the updates :-) Aabout the linter bot: I forgot to point you to the styler addin for RStudio & its "Style active file" function before, sorry! It should prevent at least 90% of those minor issues.

I am aware of this. Sometimes I forget to run it :P

tintinthong avatar Aug 14 '19 06:08 tintinthong

I am aware of this. Sometimes I forget to run it :P

Thanks again for this PR and for your other contributions so far Justin. I'll leave the review to @katrinleinweber, just wanted to mention that we recently merged in config & installation instructions for a pre-commit hook (because it's easy to forget to run styler). Please feel free to try that out and let us know if you have any issues (or suggest updates to the README instructions for contributors).

jonmcalder avatar Aug 14 '19 12:08 jonmcalder

I am aware of this. Sometimes I forget to run it :P

Thanks again for this PR and for your other contributions so far Justin. I'll leave the review to @katrinleinweber, just wanted to mention that we recently merged in config & installation instructions for a pre-commit hook (because it's easy to forget to run styler). Please feel free to try that out and let us know if you have any issues (or suggest updates to the README instructions for contributors).

@jonmcalder thats really useful. Thanks!

tintinthong avatar Aug 15 '19 01:08 tintinthong

@katrinleinweber I thought I would update(pull) your recent commits and also jonmcalders commits in master and push back to my branch so that everything is in-sync but I am having some build issues. Do you know what might be the problem?

Here is a link to my git tree

You are represented in two icons. One shown as in the sidebar and the other as a yellow circle

tintinthong avatar Aug 16 '19 08:08 tintinthong

Right now, I can only say that there seem to be linting issues, still. I don't have time in the next few days for this, apologies!

katrinleinweber avatar Aug 16 '19 18:08 katrinleinweber

@katrinleinweber no worries ahhh thank u. sorry did not know how to see the errors. seems alright now. thanks for the help!!

tintinthong avatar Aug 17 '19 04:08 tintinthong