Author Topic: Input  (Read 4194 times)

0 Members and 1 Guest are viewing this topic.

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Input
« on: July 25, 2012, 06:05:56 pm »
I tried looking at the source of a bunch of Axe games, but all I got was a bunch of stuff like :" YTOJEB"
??? It made no sense!
I've tried using the input command, but I couldn't get that to work, either.

So, how?

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: Input
« Reply #1 on: July 25, 2012, 08:49:22 pm »
I'm not sure, but if I recall correctly, the Input command was kinda buggy in Axe and it was never fixed, due to OS limitations. You had to create your own name input routine.

Not sure what's YTOJEB though.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Input
« Reply #2 on: July 25, 2012, 09:00:44 pm »
I always just used ztrumpet's routine for text input. :)
« Last Edit: July 25, 2012, 11:51:42 pm by parserp »

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: Input
« Reply #3 on: July 25, 2012, 09:02:01 pm »
I got it from ztrumpet's Jump! source. Here's the code that he used to input a name:
Spoiler For Spoiler:
:Disp "Type Your Name:"
:Output(0,5)
:"WRMH"→GDB5
:det(3)
:"VQLG"
:det(3)
:"ZUPKFC"
:det(1)
:" YTOJEB"
:det(2)
:"XSNIDA"
:"                "→GDB9
:
:Repeat B=54 and (A≠0
:getKey→B
:If B=56 and (A≠0
:A-1→A
:Output(A,5,' '►Frac)
:Output(A,5)
:End
:If B=15
:0→A
:Output(0,5,GDB9)
:Output(0,5)
:End
:If A<16
:If B>10 and (B<48)
:If {B+GDB5-11}→C
:Disp C►Frac
:C→{A+L1}
:A+1→A
:End
:End
:End
:End
:While A<19
:0→{A+L1}
:A+1→A
:End

It starts with the setting of some strings, then somehow uses those strings as a 'getKey # to letter' algorithm. Now that I think about it and look at my calc's keys, they look like the letters in each column of keys... I still don't fully understand how it works, though.

EDIT:  :ninja:, and thanks!
« Last Edit: July 25, 2012, 09:13:28 pm by dinosteven »

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Input
« Reply #4 on: July 25, 2012, 09:40:20 pm »
this routine first checks if the key pressed is within the range of values 10 and 48, meaning it's one of the keys in the alphanumeric section. then it subtracts 11 from that, so key 11 would point to entry 0 in GDB5, 12 to 1, and so on. z has the GDB stored so that every value points to its proper letter, with keys in that region that don't have a letter pointing to the value 0 instead.

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: Input
« Reply #5 on: July 25, 2012, 11:23:04 pm »
Thanks, makes sense.