Author Topic: I need help with a code!  (Read 9469 times)

0 Members and 2 Guests are viewing this topic.

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
I need help with a code!
« on: September 09, 2011, 11:03:22 am »
I'm trying to code "TapTapRevenge" for TI84+
But I need to know how to write a few things in Axe:

---How to copy a text into the code of a progam?

---How to read numbers of the code of a program an save them as Vars?

---Is it possible to play a sound WHILE calculating things and displaying pictures (so that the program wont stop while playing the sound)



(maybe more questions will follow later)
*insert supercool signature*

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: I need help with a code!
« Reply #1 on: September 09, 2011, 11:06:34 am »
This could have been asked in Q&A, but I'll still try to answer...

1) Where do you want to copy it from? I don't understand that question.
2) This might be useful.
3) I don't think so, the last time I used sound, I couldn't have like background music, only little sounds now and then, but I haven't been keeping up with Axe a lot, so don't take my answer as a solution.

Ashbad

  • Guest
Re: I need help with a code!
« Reply #2 on: September 09, 2011, 11:23:34 am »
3) practically no.  they're separate actions and can't be done simultaneously, unless you do it a certain way that isn't worth the time or space.  You could, but then the game would be very slow.  Though, what's so bad about rendering *then* playing?

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: I need help with a code!
« Reply #3 on: September 09, 2011, 11:27:24 am »
Playing sounds while calculating stuff is pretty much impossible if using Axe, and if you're using assembly, it will be incredibly hard and you probably won't get much done while playing sound.

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: I need help with a code!
« Reply #4 on: September 09, 2011, 11:28:19 am »
Thanx for the link, ephan!

I need:

1.     copying text from a string into a code

2.     sopying a var into a code (not "A", it should be the number that is saved as the var!)

3.     loading (reading) such a number from a code (like in 2.) and saving it as a var again



Is it possible to run two programs at the same time??
I don't thing so, or?





How is ththe thing working in the "MarkTheSuperkidQuest"-app?
I tried to load the appvar and wanted to watch it.
I haven't changed anything.

But the app told me that the App-var had been manipulated, and deleted it!

how hase the App noticed anything of what I made??
« Last Edit: September 09, 2011, 12:14:47 pm by p2 »
*insert supercool signature*

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: I need help with a code!
« Reply #5 on: September 09, 2011, 12:02:42 pm »
p2, you can't double post in so short time. Use the Modify button or the Quick Modify button:





Maybe you should reread the rules, in particular rule 4.

-------------------------

Is it possible to run two programs at the same time??
I don't thing so, or?
[/quote]

No, the 84+ doesn't have multithreading.

-------------------------

Now, concerning the rest of the questions, show us what you have coded so far, we are not going to make your program for you ;)

Also, if you haven't made anything and don't know where to start, be more specific in your questions, don't just tell us what you want to make, but also tell us what you have difficulties with.
« Last Edit: September 09, 2011, 12:03:21 pm by ephan »

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: I need help with a code!
« Reply #6 on: September 09, 2011, 12:34:08 pm »

---Is it possible to play a sound WHILE calculating things and displaying pictures (so that the program wont stop while playing the sound)

If you want to be technical, not on the calculators. They can only handle one thread. That means you can do one thing at a time and no more. On the other hand, you can "fake" simultaneity by using interrupts.
« Last Edit: September 09, 2011, 12:34:42 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: I need help with a code!
« Reply #7 on: September 09, 2011, 12:49:52 pm »
ephan, my problem is: I have no idea how to do tthat. I've tried very often in very much difficult ways, but never made it! (in all the cases!)
Querty.55, Hä??? How to do that???? I've never used "interrupts" before (or I have and don't know it)!



The program is reacting on the keys [7], [8] and [9]
But I will change:

It should read a program like that:
Code: [Select]
:000
:000
:100
:200
:200
:011
:022
the three numbers should be like the three keys - but 0 is like not pressing the key, 1 is like pressing it once, 2 is like holding the key!



And I also need a second program, which should react on the keys, but writes it into such a code!



sorry, I know I'm making veeeery much mistakes and I'm sometimes really too stupid to code!  :-\

Spoiler For surcecode:
:.TAPTAP01
:Full
:
:
:
:Line(14,13,82,13)r
:Line(14,51,82,51)r
:
:
:Repeat getKey(15)
:DispGraphr
:getKey(36)→A
:getKey(28)→B
:getKey(20)→C
:
:
:
:
:Lbl 1
:If C
:32→E
:End
:If B
:18→E
:End
:If A
:4→E
:End
:
:
:If A+B+C≠0
:If pxl-Test(18,50-E) or pxl-Test(17,50-E)r or pxl-Test(16,50-E)r
:For(X,13,15
:Line(X,48-E,X,52-E,1
:Line(X,48-E,X,52-E)r
:End
:End
:!If pxl-Test(18,50-E
:!If pxl-Test(17,50-E)r
:Line(16,47-E,16,53-E
:Line(17,46-E,17,54-E
:Line(18,46-E,18,54-E
:Line(19,46-E,19,54-E
:Line(20,47-E,20,53-E
:End
:End
:
:
:DispGraphr
:
:
:If A
:0→A
:Goto 1
:End
:
:If B
:0→B
:Goto 1
:End
:
:If C
:0→C
:Goto 1
:End
:
:End
:
:
:
:
:For(X,1,9
:Line(X,1,X,63
:End
:
:
:For(X,1,63
:Pxl-Off(10,X
:End
:
:DispGraphr
:DispGraph
:Horizontal +r
:Horizontal +
:Pxl-Off(83,13)r
:Pxl-Off(83,51)r
:Pxl-On(14,13)r
:Pxl-On(14,51)r
:
:End


EDIT:
Sorry, was the ASM-program surce-code is coming...
« Last Edit: September 09, 2011, 01:39:32 pm by p2 »
*insert supercool signature*

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: I need help with a code!
« Reply #8 on: September 09, 2011, 01:18:03 pm »
Querty.55, Hä??? How to do that???? I've never used "interrupts" before (or I have and don't know it)!

I recommend you read this (the attached file), it's very good!

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: I need help with a code!
« Reply #9 on: September 09, 2011, 01:58:29 pm »
Thanx, Querty!

But may someone please tell me, if there's a bug in my code?
*insert supercool signature*

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: I need help with a code!
« Reply #10 on: September 09, 2011, 03:40:50 pm »
Code: [Select]
.Change "NAME" to the name of your program
"prgmNAME"→Str1
Unarchive Str1
GetCalc(Str1)→H

So change "NAME" in "prgmNAME" to the name of your program, and make sure it exists.

After running that code, the code of the prgmNAME will be in variable H. And then you can access it byte by byte like:


Save first byte in variable A and the second byte in variable B:
Code: [Select]
{H}→A
{H+1}→B

I think this it how it works :)

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: I need help with a code!
« Reply #11 on: September 09, 2011, 05:26:29 pm »
If you're interested in sound and stuff, look around for Quigibo's Axe to Midi converter. I think it came with a set of subroutines/interrupts that allowed you to play the game while listening...
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: I need help with a code!
« Reply #12 on: September 10, 2011, 04:26:49 am »
Thanx, Ephan!!!! Can I also write a number from 1-7 into every line of the program and load them then??
For example, how to load the number in line number eight?
How can I tell the program to write a number in a new line?

And a second question:
I have such a code:
Code: [Select]
:001
:102
:202
:202
:210
How can I load the X-th number  in line Y??




Buttsfredkin, I thought it was a midi-to-axe-converter     ;)
Can you please post an example-code for me (I can learn it easier if I can exit a complete code with the new part in it)
I was planning g to use that converter, but don't really know how I must write that!
« Last Edit: September 10, 2011, 04:28:45 am by p2 »
*insert supercool signature*

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: I need help with a code!
« Reply #13 on: September 10, 2011, 06:16:45 am »
How can I tell the program to write a number in a new line?

And a second question:
I have such a code:
Code: [Select]
:001
:102
:202
:202
:210
How can I load the X-th number  in line Y??

I think this is how you do it:

1. You save the original file in a variable, let's say H.
Code: [Select]
.Change "NAME" to the name of your program
"prgmNAME"→Str1
Unarchive Str1
GetCalc(Str1)→H

2. If every line has 3 numbers, then each line has 3 bytes, so you do like this:

Line 1: Byte $0, $1 and $2
Line 2: Byte $3, $4, and $5
Line 3, Byte $6, $7, and $8
Line 4, Byte $9, $A, and $B

Then it's easy. You make a loop that loops all lines. Thus, you can access each of the 3 bytes in each line, to get the first, the second and the third number and save it into a variable ;)

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: I need help with a code!
« Reply #14 on: September 10, 2011, 08:43:02 am »
so I cant write {Str1+18}???
(Str1 because your older post...)
*insert supercool signature*