Skip to content

Commit

Permalink
r/reverse-string: 1st iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Apr 12, 2024
1 parent 1a7fd6a commit cd1f232
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
1 change: 1 addition & 0 deletions r/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@

- [raindrops](./raindrops/README.md)
- [leap](./leap/README.md)
- [reverse-string](./reverse-string/README.md)
7 changes: 6 additions & 1 deletion r/reverse-string/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ Some examples:

### Based on

Introductory challenge to reverse an input string - https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb
Introductory challenge to reverse an input string - https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb

### My Solution

- [reverse-string.R](./reverse-string.R)
- [run-tests](./run-tests-r.txt)
2 changes: 1 addition & 1 deletion r/reverse-string/reverse-string.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
reverse <- function(text) {
return(stringi::stri_reverse(text))
}
67 changes: 67 additions & 0 deletions r/reverse-string/run-tests-r.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Running automated test file(s):


===============================================================================

Running: ../../.github/citools/r/r-test

Running R Tests

R versions:

R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.


Rscript (R) version 4.3.3 (2024-02-29)


==============================================================================

Running: Rscript test_reverse-string.R

Test passed 😸
Test passed 🥇
Test passed 🌈
Test passed 😸
Test passed 🥳
Test passed 😸

real 0m0.667s
user 0m0.604s
sys 0m0.065s


==============================================================================

Exit code: 0

real 0m0.849s
user 0m0.685s
sys 0m0.176s

real 0m0.853s
user 0m0.687s
sys 0m0.178s

===============================================================================

Running: misspell ./reverse-string.R ./test_reverse-string.R

real 0m0.020s
user 0m0.021s
sys 0m0.006s

===============================================================================

/home/vpayno/git_vpayno/exercism-workspace/r

===============================================================================

0 comments on commit cd1f232

Please sign in to comment.