aboutsummaryrefslogtreecommitdiff
path: root/entries/lilylin/fractran/src/core.rs
diff options
context:
space:
mode:
authorfunemy2022-10-25 09:14:27 +0000
committerfunemy2022-10-25 09:14:27 +0000
commitfcb5f2ad8d901f1df33ada07e6888ab05806f33a (patch)
tree3197b98ae26924add5dbb8fc0103ae27e71da9a1 /entries/lilylin/fractran/src/core.rs
parent2f43aade2ed78389b32fd48598a2bf85ca9fdd9c (diff)
parent9375f87d202403e93ea4196e60de24fd9a9ea065 (diff)
Merge branch 'main' of github.com:braxtonhall/fib
Diffstat (limited to 'entries/lilylin/fractran/src/core.rs')
-rw-r--r--entries/lilylin/fractran/src/core.rs44
1 files changed, 0 insertions, 44 deletions
diff --git a/entries/lilylin/fractran/src/core.rs b/entries/lilylin/fractran/src/core.rs
deleted file mode 100644
index 26e1a67..0000000
--- a/entries/lilylin/fractran/src/core.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-use num_traits::Pow;
-
-pub type FracSize = u16;
-
-#[derive(Debug)]
-pub struct Program {
- pub fractions: Vec<(FracSize, FracSize)>,
- pub initial: u64,
-}
-
-impl Program {
- // http://lomont.org/posts/2017/fractran/
- // A lesser known Conway FRACTRAN program is FIBONACCIGAME:
- // `{17/65, 133/34, 17/19, 23/17, 2233/69, 23/29, 31/23, 74/341, 31/37, 41/31, 129/287, 41/43, 13/41, 1/13, 1/3}`
- // Starting with `78*5^(n-1)`, it halts on `2^Fn` where Fn is the nth [Fibonacci number]
- pub fn fibonacci(i: u32) -> Program {
- Program {
- fractions: vec![
- (17, 65),
- (133, 34),
- (17, 19),
- (23, 17),
- (2233, 69),
- (23, 29),
- (31, 23),
- (74, 341),
- (31, 37),
- (41, 31),
- (129, 287),
- (41, 43),
- (13, 41),
- (1, 13),
- (1, 3),
- ],
- initial: 78 * 5u64.pow(i),
- }
- }
-}
-
-pub trait FractranEngine<Value>: IntoIterator<Item = Value>
-where
- Value: From<u64>,
-{
-}