This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Radical Pi
Pages: 1 2 3 [4] 5 6 ... 80
46
« on: March 11, 2010, 07:27:51 pm »
There's not really any way around the sub issue, unless I don't use strings at all. But then what's the alternative, matrices? I'd rather not have a matrix that big here :"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X XX X X XX X X X XX X X X X XX XX X X X XX X X X XX X X X XX XX X X XX X X XX X X X XX X X XX X X X XX X XX X X X X XX X X X XX X X X X XX X X X X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX→Str1 :20→L :40→W :10→R :20→C :7→P :13→Q :For(A,1,8 :Output(A,1,sub(Str1,WP-2W+Q+WA,16 :End :Output(4,8,"π :Repeat K=45 :Repeat max(Ans={24,25,26,34,45 :getKey→K :End :C-(K=24 and sub(Str1,WR-W-1+C,1)=" ")+(K=26 and sub(Str1,WR-W+1+C,1)=" →B :R-(K=25 and sub(Str1,WR-2W+C,1)=" ")+(K=34 and sub(Str1,WR+C,1)=" →A :min(L-7,max(1,P+Ans-R+(K=25 and R-P>4)-(K=34 and R-P<3→P :min(W-15,max(1,Q+B-C+(K=24 and C-Q>8)-(K=26 and C-Q<7→Q :A→R :B→C :For(A,1,8 :Output(A,1,sub(Str1,WP-2W+Q+WA,16 :End :Output(R-P+1,Ans-Q+1,"π :End
And with that, I think I'm done with this random mini-project.
47
« on: March 11, 2010, 12:53:47 pm »
I think I understand that as well as I possibly could without seeing it in code. Thanks. I'll rewrite my engine with those things in mind later when I have the time.
EDIT: I added these two lines between the Q+B-C→Q and the A→R line. I'm aware of how hideously inefficient this entire program is right now, but as long as it works for now I'm fine with it.
P+(K=25 and R-P+1>5)-(K=34 and R-P+1<4→P Q+(K=24 and C-Q+1>9)-(K=26 and C-Q+1<8→Q This has the convenient side-effect of letting you freely move between the center square of coordinates without scrolling.
48
« on: March 11, 2010, 12:50:37 pm »
I'll never cease to be amazed with the things you people can do with a graphing calculator. If this is what we can do ten years after the 83+ came out, what kinds of things will we be doing after twenty years?
49
« on: March 11, 2010, 01:03:51 am »
Sure, but I probably won't be doing anything with them yet.
50
« on: March 11, 2010, 12:34:47 am »
Practically on an impulse, I decided to try and make a typical movement-with-a-string-map routine, but this map is 20x40 and scrolls. I also wanted it to stop scrolling when it gets to the edge of the map (domain error prevention, plus I think it's a nice effect). So when that happens, the player who has been so far stuck in the middle of the screen becomes off-centered. What I want to do next though is when you move away from the edge of the map, I want to re-center the player (one step at a time, of course). I'm probably not explaining this adequately...
Also, I'd prefer if no one gave me an answer in code. Just the theory behind it, so I can still get my practice.
:"a huge string implementation of a 20x40 map→Str1 :10→R :20→C :7→P :13→Q :For(A,1,8 :Output(A,1,sub(Str1,40P-80+Q+40A,16 :End :Output(4,8,"π :Repeat K=45 :Repeat max(Ans={24,25,26,34,45 :getKey→K :End :R-(K=25 and sub(Str1,40R-80+C,1)=" ")+(K=34 and sub(Str1,40R+C,1)=" →A :C-(K=24 and sub(Str1,40R-41+C,1)=" ")+(K=26 and sub(Str1,40R-39+C,1)=" →B :P+A-R→P :Q+B-C→Q :A→R :B→C :min(13,max(1,P→P :min(25,max(1,Q→Q :For(A,1,8 :Output(A,1,sub(Str1,40P-80+Q+40A,16 :End :Output(R-P+1,C-Q+1,"π :End Disregard how it's not optimized right now. I'll do that after getting it all to work.
51
« on: March 11, 2010, 12:11:00 am »
I didn't have any asm programs at the time, as far as I can remember. I don't even remember how I got the glitch, just that I did, at least twice. If I knew how to recreate it, I would try though.
52
« on: March 10, 2010, 11:14:14 pm »
All I know of is xLib, but I'm sure there are others, so what are they and which ones are the best/most used/still frequently updated?
53
« on: March 10, 2010, 09:25:49 pm »
Nice routines! And great way to store huge amounts of text!
54
« on: March 10, 2010, 09:08:09 pm »
I forgot most animes are that short. Most of the shows I've marathoned through have at least 100 hour-long episodes. Then again, that's why I switch between typical show and anime whenever I finish a series
55
« on: March 10, 2010, 09:01:56 pm »
I've gotten the Equ>String( glitch on my 84+SE with OS 2.30 o_o I don't think it was caused the exact same way you did, but the results were definitely the same: huge equations show in memory, they turn out to be a gigantic mass of garble in the Y= editor, and then it just goes crazy
56
« on: March 10, 2010, 08:36:05 pm »
I tend to like things with deep plots... Maybe I'll give this anime a watchthrough. How long is it?
57
« on: March 10, 2010, 05:35:33 pm »
That's much more elegant *saves routine for later use*
58
« on: March 10, 2010, 05:27:48 pm »
Well I just decided to use a turn counter in my C4 program, but this is still an interesting problem. Your pseudo-recursive solution is nice, albeit big, but it can easily be extended to find the min of any matrix in general: assuming the dimensions of the matrix are {R,C}... R->dim(L1 For(B,1,R [A](B,1 For(A,2,C min(Ans,[A](B,A->L1(B End End min(L1 But I still hate how there doesn't look to be an elegant way to do this
59
« on: March 10, 2010, 05:15:07 pm »
Here are the finished versions of both programs. Now it doesn't go into an infinite loop if you fill up the board Again, if anyone sees any optimizations, don't hesitate to tell me; I literally want to shave off every byte possible. I still think there must be a better way to check if a player has won, but I have no idea how. Also, if anyone has any idea how I could improve the AI (as in, make an AI that does more than choose a random unfilled column), I'd love to hear it. Anyway, here's the code. A zip of it is attached too. :Disp "WILL YOU MOVE :Input "FIRST? Y/N: ",Str1 :Str1≠"Y→T :{6,7→dim([A] :Fill 0,[A] :ClrHome :For(A,2,7 :Output(A,2,". . . . . . . :End :Output(8,2,"------------- :DelVar URepeat W or U=42 :If T :Then :Repeat not([A](1,Ans :randInt(1,7→C :End :prgmZG :Else :DelVar M4→C :Repeat M :Output(1,2C,"V :Repeat max(K={21,24,26,45 :getKey→K :End :If K=45 :Return :If K=21 and not([A](1,C :Then :prgmZG :1→M :Output(1,2C," :End :If K≠21 :Then :Output(1,2C," :C-25+Ans→C :Ans-7(Ans=8)+7not(Ans→C :End :End :End :{1,1,1,1→L1 :T+1→T :1→A :While A<4 and R+A≤6 and Ans :If T=[A](R+A,C :Then :1+L1(1→L1(1 :A+1→A :Else :0 :End :End :1→A :While A<4 and C-A≥1 and Ans :If T=[A](R,C-A :Then :1+L1(2→L1(2 :A+1→A :Else :0 :End :End :1→A :While A<4 and C+A≤7 and Ans :If T=[A](R,C+A :Then :1+L1(2→L1(2 :A+1→A :Else :0 :End :End :1→A :While A<4 and R+A≤6 and C+A≤7 and Ans :If T=[A](R+A,C+A :Then :1+L1(3→L1(3 :A+1→A :Else :0 :End :End :1→A :While A<4 and R-A≥1 and C-A≥1 and Ans :If T=[A](R-A,C-A :Then :1+L1(3→L1(3 :A+1→A :Else :0 :End :End :1→A :While A<4 and R+A≤6 and C-A≥1 and Ans :If T=[A](R+A,C-A :Then :1+L1(4→L1(4 :A+1→A :Else :0 :End :End :1→A :While A<4 and R-A≥1 and C+A≤7 and Ans :If T=[A](R-A,C+A :Then :1+L1(4→L1(4 :A+1→A :Else :0 :End :End :max(3<L1→W :not(T-1→T :U+1→U :End :ClrHome :If Ans≠42 and W :Then :Disp "YOU "+sub("LOSEWIN!",4T+1,4 :Else :"TIED GAME :DelVar RR :Repeat Ans=5 or [A](Ans+1,C :Ans+1 :End :Ans+(Ans=5 and not([A](6,C→R :T+1→[A](Ans,C :Output(R+1,2C,sub("XO",T+1,1
60
« on: March 10, 2010, 03:15:40 pm »
While trying to finish my simple Connect 4 game to detect tied games (aka the board matrix is all nonzero), I realized that min( isn't overloaded to handle matrices, so I'm in need of some ingenuity. Since I realized I only have to care about the min of the top row, my current solution is this: Matr>list([A]T,L1 min(L1
But I want to know if there's a better way to do this. And I also want to know how to do the general case of finding the minimum of an entire matrix rather than just the top row like I did.
EDIT: Actually my current idea doesn't work either. Now I'm utterly clueless.
EDIT2: lol it's min(L1, not min(Ans. Disregard my last edit.
Pages: 1 2 3 [4] 5 6 ... 80
|