-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Affin cipher fix #125
base: main
Are you sure you want to change the base?
Affin cipher fix #125
Conversation
This comment has been minimized.
This comment has been minimized.
2 similar comments
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")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Weird. lintbot said all variable names must be lowercased but did not address all my cases (ie i used splitList but it did not detect it)
This comment has been minimized.
This comment has been minimized.
2 similar comments
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. |
config.json
Outdated
"slug": "affine-cipher", | ||
"uuid": "9bc3f040-9e4b-4ed0-b23c-3ae565e83a59", | ||
"core": false, | ||
"difficulty": 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you consider this substantially more difficult than crypto-square
or tournament
? Those are 4
s, so we should have an argument here to introduce 5
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: I use https://jonmcalder.shinyapps.io/exercism-config-viz/ BTW to visualise where a new exercise might fit into the track structure. Please feel free to suggest an unlocked_by
;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katrinleinweber (For me) I do not necessarily feel that affine-cipher is difficult at all (tournament is more difficult tho). However, I do feel that the reader contends with a high overhead of needing to find out gcd and MMI as pre-requisites of solving the question. As expected I checked in python and crypto-square was 1 whereas tournament and affine-cipher was 5. The rust track does not have affine-cipher but rates tournament and crypto-square both as 4. I am happy to rate affine-cipher at 4, however, to the non-mathematically inclined will experience it to be a bit harder than normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally. for the student. We would want to break it up into smaller pieces and make each piece as pre-requisite. These are the unlocked_by
tree; in brackets it is difficulty.
- Ideal Option
prime-factors (3)-> gcd (3) -> mmi (2) --> affine-cipher(3)
crypto-square (4) -> affine-cipher(3)
If these pre-requisites exist for affine-cipher, it's difficulty should dampen. And the true task of affine cipher is just to put gcd and mmi together and also handle the normalisation-- that's all.
- Practical Option
prime-factors (3) ->affine-cipher(4)
The reason I include the practical option is because. 1) unlocked_by
cannot have a many-to-one dependence (correct me if I am wrong). 2) Do not want to add too many new exercises just for the sake of affine-cipher.
In addition, I should add the pre-requisite of being able to solve a gcd function in the README.md. I noticed I have not made it as clear as how I have done for the MMI.
} | ||
|
||
|
||
decrypt <- function(encryption, a, b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does encryption
mean the ciphertext here? If yes, please consider renaming it. message
-> plaintext
might also be a good idea then, because those are the domain terms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Agreed.
# must check a and m are coprime | ||
if (gcd(a, m) != 1) { | ||
stop("a and 26 must be co-prime") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of L11-14, see https://github.com/exercism/r/pull/125/files#r312707113
exercises/affine-cipher/example.R
Outdated
gcd <- function(x, y) { | ||
r <- x %% y | ||
return(ifelse(r, gcd(y, r), y)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of L5-9, see https://github.com/exercism/r/pull/125/files#r312707113
exercises/affine-cipher/example.R
Outdated
|
||
# must check a and m are coprime | ||
if (gcd(a, m) != 1) { | ||
stop("a and 26 must be co-prime") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should 26
be hard-coded here? I think stop
can act like paste
in that m
could be inserted dynamically here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes okay
exercises/affine-cipher/example.R
Outdated
# removed whitespace & lower-cased | ||
parsedmessage <- tolower(gsub(" ", "", message)) | ||
# list of letters | ||
splitlist <- strsplit(parsedmessage, "")[[1]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be variables names here, that don't require a comment above them?
This comment has been minimized.
This comment has been minimized.
2 similar comments
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)
^~~~~~~~~~~ |
This comment has been minimized.
This comment has been minimized.
2 similar comments
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 |
This comment has been minimized.
This comment has been minimized.
2 similar comments
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)
~^~~ |
This comment has been minimized.
This comment has been minimized.
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 |
@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!! |
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 branchaffine-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 onaffine-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.