Join us on Discord!
You can help CodeWalrus stay online by donating here.

Porting TI-BASIC to HP PPL

Started by gogogoluke, January 06, 2016, 07:41:31 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Dream of Omnimaga

I'll check later to see if it's monospaced in my old screenshots. If it isn't except in the editor, then that might explain why the program editor had speed problems. :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gogogoluke

#16
EXPORT Street_Poker()
BEGIN
PRINT();
remove(1=1,L2);
remove(1=1,L1);
0▶C;
INPUT(B,"Playercount");
0▶L1(B);
0▶L2(B);
INPUT(H,"Health");
1▶X;
WHILE X≤B DO //Was a bit lazy when setting up lists, but this works.
H▶L2(X); //setuphealth
" "▶L1(X); //fallen
X+1▶X;
END;
[[1,0,3,1],[4,3,10,4],[15,10,5,0],[12,11,15,10],[20,11,10,8],[17,16,17,4],[20,15,20,19]]▶M0; //Move statistics
[[6,0],[6,3],[6,5],[8,10],[10,8],[60,0],[30,40]]▶M1; //Move HP Withdrawl

WHILE 1=1 DO //Begin Gameplay
WHILE 1=1 DO //Like goto on ti, except with BREAK
  PRINT();
  C+1▶C; //Go to the next player
  IF C==B+1 THEN //Set player to one if current player does not exist
   1▶C
  END;
  IF L1(C)=="F" THEN //Check if player is fallen
   IF RANDINT(4)==0 THEN
    " "▶L1(C); //Denotes that no, player is not fallen
    PRINT(C + " got up");
   END;
   BREAK; //basically goto line 21
  END;
  WAIT();
  0▶H;
  IF L2(C)≤0 THEN //if player has no health, move to next player
   BREAK;
  END;
  WHILE H<B AND B≤14 DO //Display players, HP counts, and Fallen status
   H+1▶H;
   PRINT(L1(H) + L2(H));
  END;
  WAIT();
  C▶D; //starts while loop
  WHILE D==C OR L2(D)≤0 DO
   INPUT(D,C);
   IF D==0 THEN
    RANDINT(1,B)▶D;
   END;
  END;
  PRINT();
  IF L1(D)==" " THEN
   PRINT("Standing");
   1▶Q;
  ELSE
   PRINT("Fallen");
   3▶Q;
  END;
  PRINT();
  PRINT("1:Poke " + M0(1,Q) + " " + M0(1,Q+1)); //inefficient way of showing all moves and their stats. yay.
  PRINT("2:Jab Poke " + M0(2,Q) + " " + M0(2,Q+1));
  PRINT("3:Foot Poke " + M0(3,Q) + " " + M0(3,Q+1));
  PRINT("4:Power Poke " + M0(4,Q) + " " + M0(4,Q+1));
  PRINT("5:Sole Poke " + M0(5,Q) + " " + M0(5,Q+1));
  PRINT("6:Shank Poke " + M0(6,Q) + " " + M0(6,Q+1));
  PRINT("7:Falcon Poke " + M0(7,Q) + " " + M0(7,Q+1));
  WAIT();
  PRINT();
  8▶P;
  WHILE P<1 OR P>7 DO
   INPUT(P);
   IF P==0 THEN
    RANDINT(1,7)▶P;
   END;
  END;
  RANDINT(1,20)▶F;
  PRINT(F);
  0▶G;
  IF M0(E,Q+1)≥F THEN
   0-1▶G;
   PRINT("Fallen");
   "F"▶L1(C);
  END;
  IF M0(E,Q) THEN
   1▶G;
  END;
  IF G≤0 THEN
   BREAK;
  END;
  PRINT("Success");
  RANDINT(1,M1(E,1))+M1(E,2)▶H;
  L2(D)-H▶L2(D);
  PRINT(H + "damage");
  WAIT();
  BREAK;
END;
END;
END;


I am having issues with the line " IF M0(E,Q+1)≥F THEN", as it says "Invalid Input"
The info button shows this:
Does anyone know why this may be happening?

@alexgt  Dj told me to add your username to the post.
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Dream of Omnimaga

Hm interesting. The error and line of code suggests that you might be trying to access a matrix element outside the matrix boundaries, but I sometimes got invalid input errors when there were no error too. Have you tried restarting your HP Prime (by pressing ON+SYMB) to see if that might fix it?

You should use some TEXTOUT_P commands to display the values of E and Q+1 to see if you are going outside the boundaries. I haven't used HP PPL in a while so at first glance I can't help much, but maybe alexgt might be able to.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gogogoluke

#18
The error occurs both in my physical calculator and in my simulated one. Once I get home from school I will take a look at those variables.

EDIT: Looked over code, I used E instead of P with the matrix. Yippee. Now to figure out why failed moves are still attacking.

EDIT 2: also solved that.
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Dream of Omnimaga

#19
Glad to hear :D, I didn't notice those actually >.<

Also backup very often. Especially the simulator, which can wipe out your data if it crashes too often. As for sprites, since you are making a Poker game, you could use the RECT_P command instead to save space then use text to draw the card icons (I think they exist in the character map). That would save space. Let me know if you need help displaying sprites, though.

EDIT: Also you scared me the other night, because I first misread Street Poker as Strip Poker <_<
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

alexgt

Awesome! glad to hear you fixed those bugs ;)\

As for sprites you can do what DJ said and use RECT_P or you can use and App but it is up to you ;)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

gogogoluke

Quote from: DJ Omnimaga on January 14, 2016, 05:45:25 PM
Glad to hear :D, I didn't notice those actually >.<

Also backup very often. Especially the simulator, which can wipe out your data if it crashes too often. As for sprites, since you are making a Poker game, you could use the RECT_P command instead to save space then use text to draw the card icons (I think they exist in the character map). That would save space. Let me know if you need help displaying sprites, though.

EDIT: Also you scared me the other night, because I first misread Street Poker as Strip Poker <_<
While strip poker on a calculator would be pretty funny, it's not even Poker. The description of the TI-83 version reads "Street Poker is a game created by Luis on his calculator. Programmed to be a mixture of Pokemon, D&D, and Street Fighter, the game has people playing in a turn based fighter game where dice rolls determine your fate."

Basically, you and your friends poke each other digitally.
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Dream of Omnimaga

Oh rofl, I see now. By the way, will you post screenshots eventually?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gogogoluke


A new game with four players.


The attacks screen. The left number is what the dice must roll at or above to make a move successful. The right number is what the dice must roll at or below in order to make you fall


The top number is what the dice rolled. (No, it's not that one xkcd joke, it just happened to be four this time.)


The results of the last move. Give calculator to player two. If you have no friends, just push zero on each selection screen to have an AI pick for you.


Different game with fallen players.
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Dream of Omnimaga

Nice to see multiplayer mode. I wonder if it would work on hardware A calcs or only the newer C hardware? I got the A one that isn't compatible with the wifi add-on and I don't think it lets me connect two calcs together via USB either.

I am curious about how the game will look like with actual graphics :) (and color)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

alexgt

Sounds cool but I have to wait to get home to see the pictures because our school blocked imgur <_<
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Powered by EzPortal