Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Game: various *mites: Four Equals Ten
Page 2 of 2 | |||||
Author | Message | ||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3839 |
In what way? because the C heap and stack don't change? SUB calls and LOCAL variables aren't implemented internally the way you think. Try making recursive FUNCTION calls instead. Best wishes, Tom Edited 2023-01-16 04:16 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1082 |
Yupp, functions break it much faster, and drop the console connection too. (partial retyping from VGA display:) 1 &h20041300 &h18700 2 &h20041088 &h18700 3 &h20040E10 &h18700 4 &h20040B98 &h18700 5 &h20040920 &h18700 6 &h200406A8 &h18700 7 &h20040430 &h18700 8 &h200401B8 &h18700 9 &h2003FF40 &h18700 10 &h2003FCC8 &h18700 11 &h2003FA50 &h18700 12 &h2003F7D8 &h18700 13 &h [7] Print i, "&h" Hex$(MM.Info(STACK)) " &h" Hex$(MM.Info(HEAP)) Error : Stack overflow, expression too complex at depth 13 >list CLS c = 0 c = Recurr(c+1) End Function Recurr(i) Print i, "&h" Hex$(MM.Info(STACK)) " &h" Hex$(MM.Info(HEAP)) Pause 100 Recurr = Recurr(i+1) end function > Not quite the same error as the 4 = 10 game, but similar... Visit Vegipete's *Mite Library for cool programs. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3653 |
We used to do something similar at school: Using four 7s, make each number from one up. You can use any of the usual mathematical operators (and parentheses). You always have to use all four 7s. You can use numbers such as 77 (using up two 7s). E.g. 77 / 77 = 1, 7/7 + 7/7 = 2. I can't recall if CEIL / FLOOR were allowed, but I think not as they probably make things too easy. John |
||||
bar1010 Senior Member Joined: 10/08/2020 Location: United StatesPosts: 197 |
Thanks for uploading this nice program, Vegipete. |
||||
Page 2 of 2 |
Print this page |