Draft Specification; version 0.0.2
Author: Jeb Rosen <email@example.com>
Washington exists because Pikachu is too difficult to use practically. To avoid being too practical, however, Washington has several pointless and confusing restrictions of its own.
Some Presidents operate on registers, which are named after presidents. Presidents that share names create ambiguity; generally, inaugurations that read data read from the earliest possible register and inaugurations that write data will write to both registers.
Before a nation is formed, the Washington register is initialized to zero. It is an error to read from an uninitialized register. Writing to an uninitialized register is allowed.
Some Presidents operate on a stack, the top of which overlaps with the registers. After pushing 3, 4, then 5 on the stack these values would be visible in the Jefferson, Adams, and Washington registers respectively. After popping two values off the stack, Washington would hold the value 3. The stack should be assumed to be of infinite length, though implementations will probably limit it.
|#||Token||Full Name||Party||Upon Inauguration|
|1||Washington||Washington, George||(None)||Move the Washington marker to the current execution position. Every Nation must be founded by Washington.|
|3||Jefferson||Jefferson, Thomas||D-R||Add the value in the register named by the following president to the value in Washington, and store the result in Washington.|
|4||Madison||Madison, James||D-R||Subtract the value in the register named by the following president from the value in Washington, and store the result in Washington.|
|5||Monroe||Monroe, James||D-R||Store the value in the Washington register into the register named by the following president.|
|6||Quincy||Adams, John Quincy||D-R||Loads the value in the register named by the following president into the Washington register. Despite accusations of corruption against Quincy, no memory corruption has been known to occur when using this instruction.|
|7||Jackson||Jackson, Andrew||D||Increment the Washington register.|
|8||VanBuren||Van Buren, Martin||D||Decrement the Washinton register.|
|9||Harrison||Harrison, William Henry||W||Do nothing.|
|10||Tyler||Tyler, John||W||As revenge for being expelled from his own party, Tyler expels (prints) the value in the Washington register. "Printing" is implementation defined.|
|11||Polk||Polk, James||D||If the Washington register contains a nonzero value, move execution to the position of the Washington marker.|
|12||Taylor||Taylor, Zachary||W||Receive a single value from input, in an implementation-defined manner.|
|13||Fillmore||Fillmore, Millard||W||Move the Washington marker to the current execution position plus the value in the Washington register.|
|14||Pierce||Pierce, Franklin||D||Push the stack. The Washington register retains a copy of its previous value.|
|15||Buchanan||Buchanan, James||D||Pop the stack.|
|16||Lincoln||Lincoln, Abraham||R||Reset the values of all registers: Washington to 0, the rest to the uninitialized state.|
|23||Harrison||Harrison, Benjamin||R||same name as #9|
|24||Cleveland||Cleveland, Grover||D||same name (and same person) as #22|
|27||Taft||Taft, William Howard||R|
|32||Roosevelt||Roosevelt, Franklin||D||same name as #26|
|36||Johnson||Johnson, Lyndon||D||same name as #17|
|37||Nixon||Nixon, Richard||R||Illegal instruction.|
|41||Bush||Bush, George H. W.||R|
|43||Bush||Bush, George W.||R||same name as #41|
|45||Trump||Trump, Donald||R||Reserved instruction until out of office|
" Every nation must be founded by Washington. Washington " 'Jackson' increments the Washington register to 1. Jackson " We want to inaugurate 'Jefferson' next, but Jefferson was a " Democratic-Republican and Jackson was a Democrat. Both parties have " "Democrat" in the name, so it is invalid to inaugurate one after the " other. Harrison was a Whig, so it is valid to inaugurate Harrison " here. Conveniently, 'Harrison' is a no-op because the real President " Harrison died so early on in his term. Harrison " 'Jefferson Washington' adds the value in the Washington register to " the Washington register, effectively doubling it. Jefferson Washington Harrison Jefferson Washington Harrison Jefferson Washington Harrison. " 'Monroe Adams' stores the value in the Washington register (now 8) in " the Adams register. Monroe Adams Harrison Jefferson Washington Harrison Jefferson Washington Harrison. " Store the value 32 in the Jefferson register, then double Washington " one more time to 64. Monroe Jefferson Harrison Jefferson Washington Harrison. " Add 8 (in Adams) to 64, then print the character 72 (ASCII 'H'). " 'Tyler' was a whig, and prints ASCII characters Jefferson Adams Tyler " 'VanBuren' decrements the Washington register, leading to " 69 (ASCII 'E'). VanBuren Harrison VanBuren Harrison VanBuren Tyler " 69 + 8 - 1 = 76 (ASCII 'L') Jefferson Adams Harrison VanBuren Tyler " Store 76 in Madison and print 'L' again. Monroe Madison Tyler " Increment 3 times to 79 and print 'O' Jackson Harrison Jackson Harrison Jackson Tyler " Store the value 79 in the Monroe register. Monroe Monroe Harrison " 'Quincy' loads the value in the given register into the Washington " register. Jefferson contains 32 from earlier, which corresponds to " ASCII ' ' (space). Quincy Jefferson Tyler " Load the value 79 back out of the Monroe register, add 8 (from the " Adams register) = 87. Print 87 (ASCII 'W'). Quincy Monroe Harrison Jefferson Adams Tyler " 'Madison' subtracts the value in the named register from the " Washington register. " Print 87 - 8 = 79 (ASCII 'O'). Madison Adams Tyler " Increment 3 times to 82, and print ASCII 'R'. Jackson Harrison Jackson Harrison Jackson Tyler " Load 76 from Madison and print 'L' Quincy Madison Tyler " Subtract 8. 76 - 8 = 68 (ASCII 'D'). Madison Adams Tyler " Load 32 from the Jefferson register, and add 1. " 33 is the ASCII value of '!'. Quincy Jefferson Harrison Jackson " Tyler is the last president to be inaugurated. The last president in " a Nation (program) determines its "Era", which is the last President " whose name is allowed. It would be an error to name Polk in this " program, because Polk served after Tyler. Tyler!Stack-based
" Every nation must be founded by Washington. Washington " Increment and double Washington up to the value of 8. Jackson Harrison Jefferson Washington Harrison Jefferson Washington Harrison Jefferson Washington Harrison " 'Pierce' pushes the stack: Washington into Adams, Adams into " Jefferson, and so on. This now stores 8 into Adams. Pierce Harrison Jefferson Washington Harrison Jefferson Washington Harrison " Push again: 8 in Jefferson, 32 in Adams. Pierce Harrison Jefferson Washington Harrison. " Print H: Add 8 (in Jefferson). Jefferson Jefferson Tyler " Print E: Decrement 3 times. VanBuren Harrison VanBuren Harrison VanBuren Tyler " Print L: Add 8, decrement. Jefferson Jefferson Harrison VanBuren Tyler " Print L, and push. Pierce Tyler " Print O: Increment 3 times. Jackson Harrison Jackson Harrison Jackson Tyler " Push O Pierce Harrison " Print space: 32 is now in Madison Quincy Madison Tyler " Print W: Pop ('Buchanan'), add 8. Buchanan Harrison Jefferson Madison Tyler " Print O: Subtract 8. Madison Madison Tyler " Print R: Increment 3 times. Jackson Harrison Jackson Harrison Jackson Tyler " Print L by popping it. Buchanan Tyler " Print D: Subtract 8. Madison Jefferson Tyler " Print !: ! is one past space, which is in Adams by now. Quincy Adams Harrison Jackson Tyler! " Pop the stack. Inconsequential at the end, but it allows Presidents up to Buchanan to be inaugurated Buchanan
" Every nation must be founded by Washington. Washington " Get to 48 (0x30 = ASCII '0') by incrementing Washington to 1, doubling " it several times, storing 8 in Adams on the way, then adding 32+8+8. Jackson Harrison Jefferson Washington Harrison Jefferson Washington Harrison Jefferson Washington Harrison Monroe Adams Harrison Jefferson Washington Harrison Jefferson Washington Harrison Jefferson Adams Harrison Jefferson Adams Harrison. " Store the target value in Jefferson. Monroe Jefferson Harrison. " Add 10: add 8 (in Adams) and increment twice. Jefferson Adams Harrison, Jackson Harrison, Jackson Harrison. " Prime the loop: subtract the target value (in Jefferson). Madison Jefferson Harrison. " Begin the loop: Washington sets a jump target. ...Washington " Add the target value and decrement. Harrison. Jefferson Jefferson Harrison VanBuren. " Print the character. Tyler! " Subtract the target value. Madison Jefferson Harrison. " Continue the loop until Washington equals 0. " Since it's the last president, this Nation is set in the Polk era. Polk...
Copyright © Jeb Rosen 2019.