Author Topic: TI-84+CSE: Connect 4  (Read 5920 times)

0 Members and 1 Guest are viewing this topic.

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
TI-84+CSE: Connect 4
« on: March 21, 2013, 08:12:10 pm »
Recently, I started in on a port of Connect 4 for the 84+CSE. It seemed only logical that this game make its debut on this color screen.

As it stands right now, here's what I've got:



Got to make sure all the holes fill properly, and the list values are correct, don't I? :p And they of course, did.



This was taken with Calc Capture. It doesn't like color, it seems. Anyways, the calc is a little bit faster than this. And I might be changing the board to blue and removing the background image, since I'm going to want to use Text on the same screen while playing.

Next up is to set up the testing to see if there is a winner.

Just thought I'd post this up here, now that I actually have something substantial to post about.

Credit to Kerm for writing up the code for the boxes and circles drawing code.
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: TI-84+CSE: Connect 4
« Reply #1 on: March 21, 2013, 10:44:29 pm »
This looks really cool. And yes CalcCapture destroys colors D:. I was a bit concerned about the speed but then I remembered that on emulator+CalcCapture it was always slower than the real thing.

I would probably either keep the board yellow and add some dark background or do like you said. Anyway nice job so far :)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: TI-84+CSE: Connect 4
« Reply #2 on: March 22, 2013, 12:06:04 am »
wow, that is looking slow, but the color makes it pretty! :)
* Sorunome wonders how quick it could get with assembly

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Re: TI-84+CSE: Connect 4
« Reply #3 on: March 22, 2013, 04:47:17 am »
Sorunome, the board takes 35 seconds to draw, and everything else is fairly instant.

DJ: I do have a background in it, look at the other screenshot above it. :p But having the background means if I display text over it, it leaves blocks of white behind the text, and makes it look not as nice. Hence switching to blue and getting rid of the background.
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: TI-84+CSE: Connect 4
« Reply #4 on: March 22, 2013, 09:13:56 am »
A couple things: Is that the circles command you're using to draw the board and pieces (it seems to draw a bit differently). If so, are you using the fast circle trick?

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Re: TI-84+CSE: Connect 4
« Reply #5 on: March 22, 2013, 10:10:43 am »
No, it's a custom thing Kerm set up for me, draws the boxes with empty circles, and there is a filled circle routine posted in the basic routines section on Cemetech. The fast circle trick does not work on the CSE. :<
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: TI-84+CSE: Connect 4
« Reply #6 on: March 22, 2013, 02:54:16 pm »
Ah ok. That's a shame. :/

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: TI-84+CSE: Connect 4
« Reply #7 on: March 22, 2013, 07:01:40 pm »
Speaking of faster circle trick, does the large-font trick still work?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: TI-84+CSE: Connect 4
« Reply #8 on: March 22, 2013, 08:23:29 pm »
Yep, just tested :

My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: TI-84+CSE: Connect 4
« Reply #9 on: March 22, 2013, 10:09:12 pm »
This can also be recreated if you use the following syntax, and this is something I recently discovered:

Compare the following two:
Circle(0,0,10 makes a slow circle at origin with a radius of 10.
Circle0,0,10,{-i} makes a fast circle of the same dimensions. The i is the imaginary I. Test it on the CSE please!
Keep trying.

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Re: TI-84+CSE: Connect 4
« Reply #10 on: March 23, 2013, 05:09:12 am »
Dapian, it doesn't work. It was removed because they added the color syntax to it. The circle drawing routine is actually faster than what it used to be, though.

As to my project, I've started in on win detection. Going to be fun to implement. :p
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: TI-84+CSE: Connect 4
« Reply #11 on: March 23, 2013, 05:14:14 am »
This can also be recreated if you use the following syntax, and this is something I recently discovered:

Compare the following two:
Circle(0,0,10 makes a slow circle at origin with a radius of 10.
Circle0,0,10,{-i} makes a fast circle of the same dimensions. The i is the imaginary I. Test it on the CSE please!

This is what I mentioned a few posts up. It's refered to as the "fast circle" trick.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: TI-84+CSE: Connect 4
« Reply #12 on: March 23, 2013, 10:17:17 am »
Dapian, it doesn't work. It was removed because they added the color syntax to it. The circle drawing routine is actually faster than what it used to be, though.

As to my project, I've started in on win detection. Going to be fun to implement. :p
I am still curious about if the trick if still present in the TI-OS code, though... I wonder if anyone has looked at the OS disassembly yet?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Re: TI-84+CSE: Connect 4
« Reply #13 on: March 24, 2013, 04:40:27 pm »
No idea. :<

Update so far today:

Win detection works and is confirmed on at least 3 directions, so I'm going to assume it's fully functional. I will be doing finalizing tests, of course.

I'm going to add some text here and there to kind of fill in the emptiness (since I'd like to have a title and who it's by on the screen somewhere) plus I need to make it so that when it is won, it will clear the tokens out and let you start over.

I think I might scrap the AI idea I had. That's going to severely bloat the code. I might give it a shot for a future version, who knows.

Edit:



So, what I have left to do:

1. Make it so it will clear out the spaces that are used

2. Make it so you keep on playing instead of dropping out of the program

3. Make the tokens fit the holes better

Thoughts?
« Last Edit: March 24, 2013, 06:42:53 pm by tifreak »
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: TI-84+CSE: Connect 4
« Reply #14 on: March 24, 2013, 07:05:34 pm »
Nice stuff :). By the way after looking carefully at the animated screenshot, do you think you could make it so when you move the coin around, it is erased with "Text(-1" instead of line by line?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)