Author Topic: Command line  (Read 17036 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Command line
« on: January 05, 2011, 11:07:51 pm »
This is an evolution of an old project of mine called TI-explorer. It's exactly what the name suggests: a calculator command line.

∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Command line
« Reply #1 on: January 05, 2011, 11:08:47 pm »
Nice graphical command line :P

OMG I lost.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Command line
« Reply #2 on: January 05, 2011, 11:19:26 pm »
My calc lost too  :P
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

SirCmpwn

  • Guest
Re: Command line
« Reply #3 on: January 05, 2011, 11:29:56 pm »
Nice!  You should take a look at my Terminal, it's a similar project.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Command line
« Reply #4 on: January 05, 2011, 11:38:15 pm »
How did you parse input? I'm trying to read the bytes typed, but that's kind of a pain.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

SirCmpwn

  • Guest
Re: Command line
« Reply #5 on: January 05, 2011, 11:41:10 pm »
The keyboard has a pattern: from Enter (9), as you move vertically, the numbers increase, and wrap around each row (almost).  Every eight vertical moves, you wrap around.  So, use getkey-11→K, and then {Str1+K} is the letter pressed, assuming Str1 is the following:
"WRMH**?[theta]VQLG**:ZUPKFC* YTOJEB**XSNIDA"
* is an invalid key, or one without a letter.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Command line
« Reply #6 on: January 05, 2011, 11:43:27 pm »
I meant how did you parse the text?  I use a lookup table to display characters, so it's not a problem for me to extract the codes.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

SirCmpwn

  • Guest
Re: Command line
« Reply #7 on: January 05, 2011, 11:58:07 pm »
Oh, I have two subroutines, CS (Compare Strings) and SW (Starts With), used like this:
sub(CS,[String1],[String2]
Which returns a 1 if they are equal, and a 2 if not.  I use this for no-arg commands.
sub(SW,[String1],[String2]
Returns a 1 if [String2] starts with [String1].  I use this for arg commands, like (I know this won't compile) sub(SW,"echo ",UserInput
Here's the code:
Code: [Select]
Lbl SW
If {r1}=0 or ({r2}=0
0
Return
End
While {r1}
If {r1}=/={r2}
0
Return
End
r1+1→r1
r2+1→r2
End
1
Return
Lbl CS
If {r1}=0
0
Return
End
While {r1} and {r2}
If {r1}=/={r2}
0
Return
End
r1+1→r1
r2+1→r2
End
If ({r1}=0 and ({r2}=/=0)) or ({r1}=/=0 and ({r2}=0
0
Else
1
End
Return

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Command line
« Reply #8 on: January 06, 2011, 12:49:24 am »
Added a desktop background :P

« Last Edit: January 06, 2011, 12:52:17 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Command line
« Reply #9 on: January 06, 2011, 12:53:42 am »
what's the mouse going to be for?
Are you going to include a flashing text cursor so you know where you are in the string?
/e

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Command line
« Reply #10 on: January 06, 2011, 12:54:39 am »
The mouse will be so that you can move the command window around [and hopefully select text]. I am planning on a cursor as well.
« Last Edit: January 06, 2011, 12:55:16 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Command line
« Reply #11 on: January 06, 2011, 01:07:37 am »
ah ok cool :)
/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: Command line
« Reply #12 on: January 06, 2011, 02:20:42 am »
So basically this would not only be a command line, but also some sort of shell?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Command line
« Reply #13 on: January 06, 2011, 02:29:00 am »
If I ever decide to implement shell features, they'll be through Doors. It's just a command line for now.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

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: Command line
« Reply #14 on: January 06, 2011, 02:55:46 am »
Ah ok. I was wondering because you mentionned being able to move the window around and stuff.