r
r copied to clipboard
Affin cipher fix
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.
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")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:1: style: lines should not be more than 80 characters.
parsedmessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exercises/affine-cipher/example.R:16:1: style: lines should not be more than 80 characters.
parsedmessage <- tolower(gsub(" ", "", message)) # removed whitespace & lower-cased
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nicely done :-) I'll review on the weekend.
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)
^~~~~~~~~~~
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)
^~~~~~~~~~~
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)
^~~~~~~~~~~
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)
~^~~
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)
~^~~
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)
~^~~
@katrinleinweber I made all changes mentioned. I made affine cipher of difficulty 4 and unlocked_by
prime-factors
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)
~^~~
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)
~^~~
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)
~^~~
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.
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
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).
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!
@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
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 no worries ahhh thank u. sorry did not know how to see the errors. seems alright now. thanks for the help!!