Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Aug 5, 2024
2 parents 61c78a0 + b470889 commit 0dca077
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/puzzles.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@
for N in open("csod_data.txt","r").read()[::-1]:
for pair in ["GC","AT"]:
if N in pair: print("".join(set(N)^set(pair)),end="")
```
```
=== "R"
```r
library(biostrings)
reverseComplement(DNAString(readLines("tdir_data.txt")))
```
=== "Julia"
```jl
f = read(open("csod_data.txt"), String)
Expand Down Expand Up @@ -251,6 +256,11 @@

print(dataset.count('A'), dataset.count('C'), dataset.count('G'), dataset.count('T'))
```
=== "R"
```r
library(biostrings)
letterFrequency( DNAString( readLines("dnct_data.txt")), letters = c("A", "C","G", "T"))
```
=== "Rust"
```rs
// to compile, save the code as dnct.rs
Expand Down Expand Up @@ -447,3 +457,9 @@
```bash
cat cdcr_data.txt | tr \ '\n' | sed 's/.*/2 * sqrt(&) - &/' | bc -l
```
=== "R"
```r
nums <- readLines("cdcr_data.txt")
nums <- as.numeric(unlist(strsplit(nums, " ")))
2 * sqrt(nums) - nums
```

0 comments on commit 0dca077

Please sign in to comment.