Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void encodeState(OutputStream out,Node n) {
- if(n==null) {
- out.write("[null]");
- } else {
- out.write("{");
- out.write(n.nodeDetails());
- encodeState(out, n.yesNode());
- encodeState(out, n.noNode());
- out.write("}");
- }
- }
- F
- F
- B
- F
- B G
- F
- B G
- A
- 1,2,3,"Does it have wings?"
- 2,0,0,"a bird"
- 3,4,0,"Does it purr?"
- 4,0,0,"a cat"
- <node identifier>
- node data
- [<yes child identfier>
- yes child]
- [<no child identifier>
- no child]
- <end of node identifier>
- <parent>,<relation>,<child>
- "Is it Red", "yes", "does it have wings"
- "Is it Red", "no" , "does it swim"
- [0x1111111 "Is It Red" => [ 'yes' => 0xF752347 , 'no' => 0xFF6F664 ],
- 0xF752347 "does it have wings" => [ 'yes' => 0xFFFFFFF , 'no' => 0x2222222 ],
- 0xFF6F664 "does it swim" => [ 'yes' => "I Dont KNOW :( " , ... etc etc ]
Add Comment
Please, Sign In to add comment