Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
BigZaphod committed Aug 4, 2011
1 parent d8bced1 commit a67ab46
Show file tree
Hide file tree
Showing 10 changed files with 1,223 additions and 0 deletions.
424 changes: 424 additions & 0 deletions ddx/cow.cpp

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions ddx/ddx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Distributed Digestion eXtentions (DDX)

(Madison, Wisconsin) We at Bovine Programming Reseach are committed to
providing the most power, synergistic technologies possible to make
software development easy for all cows and bulls. We are pleased to
annouce the first release of the powerful DDX technology. Now, a bovine
may simultaneously work on seven pieces of data at once. This increase
in power comes from the addition of just eight new instructions and is
fully backwards compatible with all existing source code. The legacy
code will all operate in the first stomach and never know that there are
six additional stomaches unused. This black-box ability provides a
simple upgrade path that we are sure will help your project grow.

12 MMm : Switch to previous stomach (if in the first stomach, move to last)

13 MmM : Switch to next stomach (if in the last stomach, move to first)

14 Oom : Move memory position back one block in all stomachs

15 oOm : Move memory position forward one block in all stomachs

16 OoM : Decrement memory value by 1 for current position in all stomachs

17 oOM : Increment memory value by 1 for current position in all stomachs

18 ooo : Set memory value to 0 for current position in all stomachs

19 mmm : If no value currently in register, sum memory at positions in all
stomachs and load into register, else if value in register write
it to all stomachs in the way specified: If the memory blocks
in all positions are zero, set the current blocks to the register
value, but if there are non-zero values at the positions, then add
them all together and call that the weighting. The register is
divided by that weighting, rounded down to the nearest integer,
call this the base. Then the remainer is calculated. Each memory
block is written as the base times its current value. A number
less than 0 gets its absolute value times the remained. For
example, if the current stomach values are "1 2 3 4 5 0 -2" and
the register has 8976, then the results would be 598 1196 1794
2392 2990 0 12. This single operation provides addition, division,
and mulitplication.


7 changes: 7 additions & 0 deletions ddx/fib-ddx.cow
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*** Fibonacci numbers using DDX ***]

[*** Setup the first two stomachs with 1s and stay in 2nd stomach ***]
MoO OOM MmM MoO OOM

[*** add together, zero prev stomach, write to next stomach, print ***]
MOO mmm MMm OOO MmM MmM MMM OOM moo
3 changes: 3 additions & 0 deletions ddx/pow7-ddx.cow
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*** calculate powers of 7 ***]
[*** add 1 to all stomachs, accumulate, zero, set from register ***]
oOM MOO OOM mmm ooo mmm moo
57 changes: 57 additions & 0 deletions examples/99.cow
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
moOMoOMoOMoOMoOmoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMMMmoOMMMMoOMoOMoOMoOMoOMoO
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMMMmoOMMMommMoOMoOMoOMoOMoO
MoOMoOMoOMoOMoOMoOMoOMMMmoOMMMMoOMoOMMMmoOMMMMoOMoOMoOMoOMoOMoOMoOMoOMoOMoO
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoO
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMMMmoOMMMMoOMMMmOomOomOomOo
mOomOoMMMMoOmoOmoOmoOmoOmoOmoOMMMmoOMMMMoOMoOMMMmoOMMMMoOMMMmoOMMMMoOMMMmoO
MMMMoOMoOMMMmoOMMMMoOMMMmoOMMMMoOMoOMMMmoOMMMMoOMMMmoOMMMMoOMoOMMMmoOMMMMoO
MMMmoOMMMMoOMMMmoOMMMMoOMoOMMMmoOMMMMoOMMMmoOMMMMoOMMMmoOMMMMoOMMMmoOMMMMoO
MoOmOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOoMOOOOMmoO
moOmoOmoOmoOmoOMoomoOmoOmoOmoOmoOmoOmoOmoOmoOMoomoOmoOmoOmoOMooMoomOomOomOo
mOomOomOoMoomOomOomOomOomOoMoomOomOomOomOomOomOomOomOoMMMMOoMOOmoOmoOmoOmoO
moOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOo
mOomOomOomOomOomOomOomOoOOOmooMMMmoOmoOmoOmoOmoOmoOmoOmoOmOomOomOomOomOomOo
MoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOoMoomOomOomOo
mOomOomOomOoMoomoOmoOmoOmoOMoomoOmoOMooMoomoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOo
mOomOomOomOomOomOomOomOomOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoO
moOmoOmoOMoomOoMoomOomOomOomOomOomOomOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoO
moOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOoMoomOomOoMoo
mOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoO
moOMoomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoO
moOmoOMooMoomOomOomOomOomOomOomOomOomOomOoMoomOomOoMoomOoOOMmoOmoOmoOmoOmoO
moOMoomoOmoOmoOmoOmoOmoOmoOmoOmoOMoomoOmoOmoOmoOMooMoomOomOomOomOomOomOoMoo
mOomOomOomOomOoMoomOomOomOomOomOomOomOomOoMMMMOoMOOmoOmoOmoOmoOmoOmoOmoOmoO
moOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOomOomOomOomOo
mOomOomOomOoOOOmooMMMmoOmoOmoOmoOmoOmoOmoOmoOmOomOomOomOomOomOoMoomoOmoOmoO
moOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOoMoomOomOomOomOomOomOomOo
MoomoOmoOmoOmoOMoomoOmoOMooMoomoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOo
mOomOomOomOomOomOomOomOomOoMoomOomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoO
moOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOomOomOomOomOoMoomoOmoOmoO
moOmoOmoOmoOMoomOomOomOomOoMoomOomOomOomOomOomOoMoomOomOoMMMmOoOOOMoOmoOMOo
MOOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOoMoomOomOomOomOomOomOo
MoomOomOomOomOomOomOomOomOomOoOOOmoOOOOmooMMMmOoMOOmoOmoOmoOmoOmoOmoOmoOmoO
moOmoOmoOmoOMoomoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOomOo
mOomOomOomOomOomOomOomOomOoOOOmoomoOmoOmoOMoomoOmoOmoOmoOmoOMoomoOmoOmoOmoO
moOmoOmoOmoOMoomoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOoMoomOomOomOomOomOo
mOomOomOomOomOomOoMoomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOo
mOomOomOomOomOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoo
MoomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoOmoO
moOmoOMoomoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOomOomOomOo
mOomOomOomOoMoomoOmoOmoOMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOoMoo
moOmoOmoOmoOmoOMoomOomOomOomOomOomOoMoomOomOomOomOomOomOomOoMoomOomOomOomOo
MoomOomOoMoomOoMOoOOMmoOmoOmoOmoOmoOmoOMoomoOmoOmoOmoOmoOmoOmoOmoOmoOMoomoO
moOmoOmoOMooMoomOomOomOomOomOomOoMoomOomOomOomOomOoMoomOomOomOomOomOomOomOo
mOoMMMMOoMOOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOo
mOomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOoOOOmooMMMmoOmoOmoOmoOmoOmoO
moOmoOmOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOo
mOomOomOomOoMoomOomOomOomOomOomOomOoMoomoOmoOmoOmoOMoomoOmoOMooMoomoOmoOmoO
moOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOoMoomoOmoO
moOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOoMoomOomOomOomOomOomOomOomOomOomOomOo
mOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOo
mOomOomOomOoMoomOomOoMoomOomOomOomOomOomOoMoomoOmoOmoOmoOmoOmoOmoOmoOmoOmoO
moOmoOmoOmoOmoOmoOmoOmoOmoOMoomOomOomOomOomOomOomOomOomOomOomOomOomOomOomOo
mOoMoomoOmoOmoOmoOmoOmoOmoOmoOMooMoomOomOomOomOomOomOomOomOomOoMoomOomOomOo
MooMoomOomoo



40 changes: 40 additions & 0 deletions examples/fib.cow
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
MoO
moO
MoO

mOo

MOO
// print first.
OOM

// temp copy of first number.
MMM
moO
moO
MMM
mOo
mOo

// store second number off in the first position now.
moO
MMM
mOo
MMM

// move back to temp number.
moO
moO

// use temp to add to first and store in second.
MOO
MOo
mOo
MoO
moO
moo

mOo
mOo
moo

8 changes: 8 additions & 0 deletions examples/i.cow
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MoO
MOO
moO
OOM
MoO
mOo
moo

Loading

0 comments on commit a67ab46

Please sign in to comment.