File tree Expand file tree Collapse file tree 7 files changed +23
-32
lines changed Expand file tree Collapse file tree 7 files changed +23
-32
lines changed Original file line number Diff line number Diff line change
1
+ ## General
2
+
3
+ - For generating random numbers, Erlang's ` :rand.uniform ` or ` Enum.random ` are
4
+ good places to start.
5
+ - ` :math.pow |> round ` can be used to find the power of a number, and ` rem ` for
6
+ the modulus.
7
+ - Neither of those works particularly well (or quickly) for very large integers.
8
+ Cryptography generally makes use of numbers larger than 1024 bits. Erlang's
9
+ ` :crypto ` module has a useful function for finding the modulus of a power,
10
+ particularly for enormous integers, but you might need ` :binary ` to decode it.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ## General
2
+
3
+ - Use ` Bitwise ` (or div/rem).
4
+ - If you use ` Bitwise ` , an easy way to see if a particular bit is set is to compare
5
+ the binary AND (` &&& ` ) of a set of bits with the particular bit pattern you
6
+ want to check, and determine if the result is the same as the pattern you're
7
+ checking.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ## General
2
+
3
+ - ` apply ` will let you pass arguments to a function, as will ` fun.(args) ` .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- Formatting the output is easy with ` String ` 's padding functions. All number
1
+ ## General
2
+
3
+ - Formatting the output is easy with ` String ` 's padding functions. All number
2
4
columns can be left-padded with spaces to a width of 2 characters, while the
3
5
team name column can be right-padded with spaces to a width of 30.
You can’t perform that action at this time.
0 commit comments