pacman -Sy #sync the database
pacman -Syy #sync the database even if it's up to date
Let's say I have the following module:
module Simple-Mod;
#| Calculate the nth fibonacci number.
multi fib( 0 ) { 1 }
multi fib( 1 ) { 1 }
multi fib( Int $n where * > 1 ) {
fib($n - 2 ) + fib($n - 1);
% Resources: | |
% http://www-math.mit.edu/~psh/exam/examdoc.pdf | |
% https://www.math.uni-bielefeld.de/~rost/amslatex/doc/amsthdoc.pdf | |
\documentclass[addpoints,answers,12pt]{exam} % exam class with 12 point type | |
\usepackage[T1]{fontenc} % replace default font encoding (OT1) | |
\usepackage{tgschola} % font used in the Book of Proof | |
\usepackage{amsmath,amsthm,amssymb,amsfonts} % packages for mathematical typesetting | |
\usepackage{pdfpages} % include pdf pages with \includepdf{dir/of/page.pdf} | |
\usepackage[makeroom]{cancel} % display expressions as cancelled |
unit module ProjectFour; | |
=begin pod | |
=TITLE ProjectFour | |
=SUBTITLE Find a route in map by backtracking using a Stack | |
The module C<ProjectFour> implements two classes (C<City> and C<RouteMap>) | |
to find a route, if one exists, from an origin city to a destination city, | |
given a particular map. In a map, a city B is adjacent to a city A if there's | |
an arrow pointing from A to B. For example, in N->Q we say that Q is adjacent |
A word ladder is a sequence of words [w0, w1, ..., wn] such that each word wi in the sequence is obtained by changing a single character in the word wi-1. All words in the ladder must be valid English words.
Given two input words and a file that contains an ordered word list, implement a routine (e.g., find_shortest_ladder(word1, word2, wordlist)
) that finds the shortest ladder between the two input words. For example, for the words cold
and warm
, the routine might return:
("cold", "cord", "core", "care", "card", "ward", "warm")
As general concept, iteration can be defined as the process of doing some repeated action over something in order to generate a sequence of outcomes. At a more detailed and programmatic level, iteration is the process of visiting all the elements of an iterable object using another object known as an iterator.
=begin pod | |
X<|Delegation> | |
=head2 Delegation | |
Delegation is a technique whereby a member of an object (the I«delegatee») is | |
evaluated in the context of another original object (the I«delegator»). In other | |
words, all method calls on the delegator are I«delegated» to the delegatee. | |
In Raku, delegation is specified by applying the L«handles|/language/typesystem#trait_handles» | |
trait to an attribute. The arguments provided to the trait specify the methods |
=begin pod :kind("Language") :subkind("Language") :category("tutorial") | |
=TITLE Iterating | |
=SUBTITLE Functionalities available for visiting all items in a complex data structure | |
Similar to other many programming languages, Raku makes a fine distinction among | |
the terms I<iteration>, I<iterable>, and I<iterator>. Familiarizing yourself | |
with them is key for understanding the Raku constructs that implement these | |
concepts: |
git clone /url/to/original/repo # clone fork
git remote add upstream /url/to/original/repo # add remote from original repo
git fetch upstream # fetch content from upstream (i.e., repo forked from)
git pull upstream master # fetch and merge upstream into master
{ | |
"recipes": [ | |
{ | |
"name": "scrambledEggs", | |
"ingredients": [ | |
"1 tsp oil", | |
"2 eggs", | |
"salt" | |
], | |
"instructions": [ |