Author Topic: Windows XP in Axe  (Read 12161 times)

0 Members and 1 Guest are viewing this topic.

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Windows XP in Axe
« on: August 12, 2015, 08:12:30 pm »
So lately, I've been thinking about making another version of Windows XP but this time, unlike every single other version that most people know of, this one will be made in axe. I already have the mouse thing set up...
Code: [Select]
.WINDOWXP
ClrDraw
ClrHome

32->Y
48->X

[E0C0A00000000000]->Pic1

Repeat getkey(15)
Pt-On(X,Y,Pic1
Line(0,0,95,0        \\Lines for a border
Line(0,63,95,63     \\
Line(0,0,63,0         \\
Line(95,0,95,63      \\
If getkey(1)
If Y(doesn't equal)61
Y+1->Y
End
End
If getkey(2)
If X(doesn't equal)1
X-1->X
End
End
If getkey(3)
If X(doesn't equal)93
X+1->X
End
End
If getkey(4)
If Y(doesn't equal)1
Y-1->Y
End
End
ClrDrawDispGraph
End
But the problem is, I don't know how to make it so the program knows if you have the cursor in the area of the START menu (for example) and if you clicked on it. To tell you the truth, I think that is the main thing that I need help with besides optimization.

Thank you for your help,
SiphonicSugar
« Last Edit: August 12, 2015, 10:56:37 pm by Eeems »
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

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: Windows XP in Axe
« Reply #1 on: August 13, 2015, 04:49:34 am »
For the start menu checking thing you have to check if the cursor is in a certain area, so something like
If X>minimumx and (X < maximumx) and (Y > minimumy) and (Y < maximumy)

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

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Re: Windows XP in Axe
« Reply #2 on: August 13, 2015, 04:12:41 pm »
Him...I never thought about that... Is there a way to put a getkey phrase on the same line as something else if connected by and?

If getkey(15) and Y(doesn't equal)1

This never works. :(
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Windows XP in Axe
« Reply #3 on: August 13, 2015, 04:16:07 pm »
That's because Axe's order of operations is simply left-to-right. So that's being evaluated like (getKey(15) and Y)≠1. Try adding parentheses, like getKey(15) and (Y≠1), or switching the order, like Y≠1 and getKey(15).

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Re: Windows XP in Axe
« Reply #4 on: August 13, 2015, 06:18:01 pm »
some quick help:
Code: [Select]
ClrDraw
ClrHome
ya don't need both if in the end, you're only going to use DispGraph every millisecond, ya can remove ClrHome

Code: [Select]
Line(0,0,95,0        \\Lines for a border
Line(0,63,95,63     \\
Line(0,0,63,0         \\
Line(95,0,95,63      \\
try the rect command, makes it easier to write (and the recti command)

Code: [Select]
Y+1->Y
...
X-1->X
they can be Y++ and X--


Here's a big optimization of your code that you might want to do yourself or not, but anyway, it's not too hard to figure out after you experiment a lot. (but I'll leave it up to you if ya wanna use it)
Spoiler For Spoiler:
min(max(getKey(3)-getKey(2)+X+1,1),96)-1->X
min(max(getKey(1)-getKey(4)+Y+1,1),64)-1->Y

this can replace the whole code after the line part
and check this out for some other optimizations
https://www.omnimaga.org/axe-language/the-optimization-compilation/
Projects:
Star Cats
Five Nights at Freddy's
Phoenix Wright

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Re: Windows XP in Axe
« Reply #5 on: August 13, 2015, 06:22:59 pm »
Okay, so, obviously when I get a little farther into making this, when you click (2nd) in the bottom left corner, it won't say START (that was just added to see if clicking works), and I'll make an actual start menu pop up.

Code: [Select]
.WINDOWXP

Fix 5

32->Y
48->X

ClrHome

[E0C0A00000000000]->Pic1

0->A

Repeat getKey(15)
Lbl 1
ClrDraw
If A=1
Text(2,56,"START
End
Pt-On(X,Y,Pic1
If getKey(1)
Y+1->Y
End
If getKey(2)
X-1->X
End
If getKey(3)
0+1->X
End
If getKey(4)
Y-1->Y
End
If getKey(54)
Goto 2
End
DispGraph
End
Lbl 2
If Y>54 and X<25
1->A
End
Goto 1

Why won't this work with the lbls? When I click on the bottom left corner, the mouse stops working correctly and it won't let me press CLEAR to end the program. Oh and Haubo, thanks for the optimization help. :D I didn't add that yet because I saw your comment after I posted again.

Edit Sorunome: Added [code]-tag
« Last Edit: August 13, 2015, 06:42:31 pm by Siphonic_Sugar »
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Re: Windows XP in Axe
« Reply #6 on: August 13, 2015, 06:40:30 pm »

Try not to use any goto's in your program unless you know what you're doing with them. Goto's don't goto a certain part of the code, they also take everything with them, including the stack. It will break the program if not used correctly. What you want to do is create subprograms. (not like you really need them here anyway :P )
Try this: (I'll change minimally)
Code: [Select]
.WINDOWXP

Fix 5

32->Y
48->X

ClrHome

[E0C0A00000000000]->Pic1

0->A

Repeat getKey(15)
ClrDraw
Pt-On(X,Y,Pic1
If getKey(1)
Y+1->Y
End
If getKey(2)
X-1->X
End
If getKey(3)
X+1->X
End
If getKey(4)
Y-1->Y
End
If Y>54?X<25?getKey(54)
Text(2,56,"START
End
DispGraph
End

Also, I think you should avoid using and's in the code too for that purpose. and doesn't actually compare it that way, check out the command list for more details. For this, use ?
Projects:
Star Cats
Five Nights at Freddy's
Phoenix Wright

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Re: Windows XP in Axe
« Reply #7 on: August 13, 2015, 06:44:38 pm »
Sure, seems like a good idea. Thanks again for optimization. :D
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Windows XP in Axe
« Reply #8 on: August 13, 2015, 07:01:36 pm »
Here's a big optimization of your code that you might want to do yourself or not, but anyway, it's not too hard to figure out after you experiment a lot. (but I'll leave it up to you if ya wanna use it)
Code: [Select]
min(max(getKey(3)-getKey(2)+X+1,1),96)-1->X
min(max(getKey(1)-getKey(4)+Y+1,1),64)-1->Y
Grrrr I was about to post the same thing myself. That's why I was asking irc about max()^r. :P :P to bad you :ninja: 'd me. XD
But as a side note are you sure it won't be better to remove those -1s and change max() to max()^r? I think that will be smaller.  ;) (but i am not sure)
-German Kuznetsov
The impossible chemical compound.

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Re: Windows XP in Axe
« Reply #9 on: August 13, 2015, 07:50:39 pm »
Hmm, where is the recti command?
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Windows XP in Axe
« Reply #10 on: August 13, 2015, 08:15:12 pm »
Hmm, where is the recti command?
[2nd][matrix(x^-1)]->math tab-> option 'B'.
-German Kuznetsov
The impossible chemical compound.

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Re: Windows XP in Axe
« Reply #11 on: August 13, 2015, 08:35:50 pm »
Okay. Thank you for your help! :D

Hey, I'm going to set aside this Windows XP project for a minute so I can ask this. I'm thinking about learning 68K basic and maybe a little more on Lua but what calculator do you guys think that I should get next?

1) TI-Nspire CX

2) TI-92 Plus

3) TI-84 Plus CE
« Last Edit: August 13, 2015, 08:40:41 pm by Siphonic_Sugar »
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

Offline Unicorn

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +0/-0
  • I am rainbows
    • View Profile
Re: Windows XP in Axe
« Reply #12 on: August 13, 2015, 08:51:05 pm »
I'm going to say CE, because its new, and we need more games/programs for it out and about ;) I might be a biased because of my CSE :P

Offline Siphonic_Sugar

  • LV3 Member (Next: 100)
  • ***
  • Posts: 51
  • Rating: +0/-0
    • View Profile
Re: Windows XP in Axe
« Reply #13 on: August 13, 2015, 08:55:08 pm »
Haha, I hate the CSE. The CE is almost 8 times faster!
I'm on Codewalr.us now too, you should check it out.
<a href="https://codewalr.us"><img src="https://codewalr.us/other/cwaffiliate.png" /></a>

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: Windows XP in Axe
« Reply #14 on: August 13, 2015, 08:58:35 pm »
Nspire CX (CAS if you can get it) It can run linux so you can really put any programming language on it. It also has Lua built in.
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3