Skip to content

Instantly share code, notes, and snippets.

View thanhnguyen2187's full-sized avatar
😶‍🌫️

Thanh Nguyen thanhnguyen2187

😶‍🌫️
View GitHub Profile
@thanhnguyen2187
thanhnguyen2187 / sample.janet
Created December 22, 2021 15:29
A sample Janet program to read a "special" csv file, convert the data into weighted options, and randomly pick one
(math/seedrandom (os/cryptorand 8))
(math/random)
(defn read-raw-text
[path]
(-> path
(file/open :r)
(file/read :all)))
(defn read-special-csv-lines
"""
Write a recursive function named `remove_odd_digits` that accepts an
integer parameter n and returns the integer formed by removing the odd digits
from n. For example, the call of `remove_odd_digits(6342118) should return
6248.`
"""
def remove_odd_digits(n: int) -> int:
if (
n == 0 or
"""
Write a recursive function that prints a solution to the classic Towers of
Hanoi puzzle. Your function should accept three integer parameters representing
the number of disks, the starting peg number, and ending peg number. Your
function should print the solution to the game to move from the given start peg
to the given end peg. For example, the call of `hanoi(3, 1, 3)` should print
the folowing output to move the three pegs from peg #1 to peg #3.
```
move disk 1 from peg 1 to peg 3
" source .vimrc
set number " nu
set relativenumber " rnu
set scrolloff=999 " so
set sidescrolloff=999 " siso
set nowrap
set nohlsearch " nohl
set textwidth=80 " tw
set colorcolumn=80 " cc
""""""""""""
" Vim Plug "
""""""""""""
call plug#begin('~/.vim/bundle')
"""""""""""""""""""
" Auto Completion "
"""""""""""""""""""
" Plug 'Valloric/YouCompleteMe'