Author Topic: Compare getkey to a list  (Read 18532 times)

0 Members and 7 Guests are viewing this topic.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Compare getkey to a list
« Reply #30 on: February 25, 2010, 03:50:11 pm »
np
yeah it does, we have more basic programmers here that are active.
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Compare getkey to a list
« Reply #31 on: February 25, 2010, 04:26:14 pm »
Hi rthprog, for some reasons when I saw your nickname on latest members I was certain you alerady signed up here before so I thought to myself: "oh crap, I accidentally deleted him in a spambot account purge x.x", but then I remembered it was Reapex who had an account. Anyway welcome here ^^

Activity-wise, we normally are more focused on calc game projects while TIBD/Cemetech are more help-oriented/non-game-oriented (and UTI an hybrid of all), but it seems there have been more activity in the help forums here lately, especially since we split TI-BASIC out of the only calc help subforum we had.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Compare getkey to a list
« Reply #32 on: February 25, 2010, 04:39:27 pm »
Repeat max(Ans={24,25,26,34
getKey->K //You don't need to store it to K, but I usually do. :)
End

Repeat max(Ans={24,25,26,34
getKey
End
Ans-->K

Takes up an extra byte, but ought to be a bit faster

Great idea!  I'm sure this is faster when no key is pressed, but I don't know if it's faster when a key is pressed.  It's nice code, though. ;D
Edit: Oh, and because of the new-line it takes two more bytes.
Welcome here! *ZTrumpet points rthprog towards the Introduce Yourself sub forum. :)
« Last Edit: February 25, 2010, 04:39:31 pm by ztrumpet »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Compare getkey to a list
« Reply #33 on: February 25, 2010, 04:42:12 pm »
*ZTrumpet points rthprog towards the Introduce Yourself sub forum. :)
He'll be scared to death D:

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Compare getkey to a list
« Reply #34 on: February 25, 2010, 05:09:32 pm »
Lol yeah, that subforum is a scary place x.x that's why I don't venture there often.
/e

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Compare getkey to a list
« Reply #35 on: February 25, 2010, 05:10:49 pm »
*ZTrumpet lols at Eeems and DJ...
The only extremely scary part is the first page of DJ's topic...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Compare getkey to a list
« Reply #36 on: February 25, 2010, 05:30:48 pm »
And you must avoid the peanuts bags being thrown from everywhere

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Compare getkey to a list
« Reply #37 on: February 25, 2010, 07:14:24 pm »
I'm sure this is faster when no key is pressed, but I don't know if it's faster when a key is pressed.

Yeah, i see this optimization a lot actually, but i tend to shy away from it.  I don't need speed when nothing is happening :P

Either way, welcome to Omnimaga! and look out for stray lobsters O.O

Offline rthprog

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +5/-0
    • View Profile
Re: Compare getkey to a list
« Reply #38 on: February 25, 2010, 08:47:34 pm »
Lol, okay.

@Builderboy
"I don't need speed when nothing is happening"

Good point.  In my defense, I'm somewhat used to leaving the "-->K" out altogether; often it is unnecessary to store the key at all.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Compare getkey to a list
« Reply #39 on: February 25, 2010, 08:58:22 pm »
That is very true :) That would be the fastest option.  Or you could be totally awesome like Weregoose and use nothing but Ans for the entire program ;D

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Compare getkey to a list
« Reply #40 on: February 25, 2010, 08:58:36 pm »
...I'm somewhat used to leaving the "-->K" out altogether; often it is unnecessary to store the key at all.
Right, and it's fastest if you don't have to store K. ;D

Edit: Ninjaed!
« Last Edit: February 25, 2010, 08:59:00 pm by ztrumpet »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Compare getkey to a list
« Reply #41 on: March 05, 2010, 01:46:34 am »
Haha at the risk of actually being on topic about the movement part of this I remember seeing something about movement code at TI-BASIC Developer. It is supposedly faster than usual and deals with ⌂List. I'm not sure how it works, with my lack of knowledge of those commands, but thought I'd throw that out there haha.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)