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

0 Members and 1 Guest are viewing this topic.

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Compare getkey to a list
« Reply #15 on: January 25, 2010, 09:37:05 am »
I use theta and I for loops.
K for getkey, of course. I didn't know of TI examples... I just followed others.

I also use F for flags (1 or 0).

The lists I prefer to use is not L1 and L2 but L5 and L6 because is more friendly to user. You rarely use them but L1 and L2 are the first used, I suppose.
Hobbing in calculator projects.

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 #16 on: January 25, 2010, 11:51:08 am »
I usually will use K for getkey, M for menu output. A and B are my vars that I use most, along with X Y C D E F in no particular order. Although I will usually use x and Y for location variables.
/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 #17 on: January 25, 2010, 02:17:21 pm »
The only bad part about everyone using K for example is that sometimes there are people who think K is the only variable that can be used with GetKey XD

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 #18 on: January 25, 2010, 02:24:39 pm »
You know what?  Now that I thing about it,  I might have used theta as my key variable up until I found donut quest.  I totaly picked apart the source :P and so many of my games were inspired one way or anoher by different parts of DQ.  Ha, even portal was a partial brainchild of DQ XD
« Last Edit: January 25, 2010, 02:50:22 pm by Builderboy »

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 #19 on: January 25, 2010, 02:32:10 pm »
You one what?
I do not understand this question.

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 #20 on: January 25, 2010, 02:51:12 pm »
Whoops,  sorry about that.  I'm on my itouch so a simple misspelling and it autocorrects to something else:P

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 #21 on: January 25, 2010, 02:53:38 pm »
lol, I hate that x.x
hmm, too bad I'm studying for bio, I want to play a game of eliminate x.x
/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 #22 on: January 25, 2010, 03:34:14 pm »
The variables I use most are A, B, C, S, T, and K.  The only variable I'll always use for something is K, so my code is probably the messyist. :P

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Compare getkey to a list
« Reply #23 on: January 25, 2010, 04:32:59 pm »
Other things I remembered: I also use theta as a "temporary" variable through all code, this means, it is used once and can be destroyed later for other function.
And I have seen "I" variable used in loops in other languages like JavaScript (but in lowercase). For nested loops, "j" is used next. :P

Also X and Y are good for position but some graph functions zeroes Y or X. So I use A and B or R and C (row and column).

I try to use a variable letter as the starting name for its function. For example, "H" for health, "J" for jump, "M" for menu or magic, etc..

Oh we are offtopic but is interesting to see there is the K variable convention.
Hobbing in calculator projects.

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 #24 on: January 25, 2010, 05:11:13 pm »
And I have seen "I" variable used in loops in other languages like JavaScript (but in lowercase). For nested loops, "j" is used next. :P
It's funny;  In C++ I use i, j, and k for my for loops, but in Ti Basic I use A, B, and C.  I'm wierd! :P
« Last Edit: January 25, 2010, 05:11:21 pm by ztrumpet »

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: Compare getkey to a list
« Reply #25 on: January 31, 2010, 10:13:46 pm »
i think of I=Increment for loops, and thus the reason i use it in for loops :{O
i'm kind of leaning towards the approach of just using variables as i get to them in order, and saving a table defining what each variable is used for when, i think this would actually be a cleaner approach because when you get to the point where every single variable is in use/has multi-uses it begins to get very confusing and you can forget what does what so you have to create tables anyway

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: Compare getkey to a list
« Reply #26 on: January 31, 2010, 10:27:37 pm »
I actually use theta for getkey, and Z for repeat group, acting something like flag.
A,B for variables I use a lot. X,Y for position (sometimes not because Y tend to change when using ClrDraw)


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline rthprog

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +5/-0
    • View Profile
Re: Compare getkey to a list
« Reply #27 on: February 25, 2010, 12:20:00 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

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 #28 on: February 25, 2010, 01:27:47 pm »
hmm, interesting. I'll have to remember that.
also welcome to Omnimaga rthprog.
/e

Offline rthprog

  • LV2 Member (Next: 40)
  • **
  • Posts: 29
  • Rating: +5/-0
    • View Profile
Re: Compare getkey to a list
« Reply #29 on: February 25, 2010, 03:31:55 pm »
@Eeems_
thanks!  Omnimaga's TIBasic subforum seems a bit more active than Cemetech's (excluding John Massey, of course)