Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 03:10:50 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 96 97 [98] 99 100 ... 110   Go Down
  Print  
Author Topic: Axe Q&A -  (Read 59432 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1455 on: 06 April, 2012, 02:40:17 »
0

I'm sorry, but I didn't quite get what you're saying. Big frown
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 02:12:15
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1456 on: 06 April, 2012, 02:42:58 »
0

Using a constant pointer like Str1 instead of a variable pointer like A is an optimization technique. Both methods will produce the same end results. But if you use a constant, your code will be smaller and faster.
Logged
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1457 on: 06 April, 2012, 02:43:59 »
0

ah, ok. Cheesy
I was stuck on where you mentioned something about 2 byte storing.
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 19:18:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #1458 on: 06 April, 2012, 02:46:24 »
0

A static variable is the same as a number to Axe, so 0→{L6}r is exactly the same as 0→{37696}r to Axe.

Variables are really shortcuts for {POINTER}r, so 0→A is exactly the same as 0→{°A}r is exactly the same as 0→{34852}r.

So if you were to do 0→{A}r, what you're really doing is  0→{{34852}r}r. That's why it's less optimized.

EDIT: Ninja'd.
« Last Edit: 06 April, 2012, 02:47:30 by Deep Thought » Logged




mrmprog
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 28 September, 2012, 05:58:25
Date Registered: 15 February, 2011, 01:35:36
Location: Somewhere
Posts: 559


Total Post Ratings: +34

View Profile
« Reply #1459 on: 08 April, 2012, 04:57:23 »
0

What is the fastest way to count the black pixels in an 8*8 area?
Logged

leafy
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 21:59:01
Date Registered: 26 December, 2010, 05:27:03
Location: the ninth circle of hell
Posts: 1545


Total Post Ratings: +371

View Profile WWW
« Reply #1460 on: 08 April, 2012, 05:40:45 »
0

I suppose you could use bit arithmetic with a pointer to a Pt-Get('ed sprite. I'm not too clear on how that would work though.
Logged

In-progress: Blastlabs, TMJO, qb?, VVVVVV?
Finished: Tag, Tap, MFQT, Nyan
Dead: Graviter
jacobly
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: Today at 00:51:46
Date Registered: 09 October, 2011, 01:53:09
Posts: 199

Total Post Ratings: +149

View Profile
« Reply #1461 on: 08 April, 2012, 06:45:57 »
0


1
2
3
4
5
6
7
8
9
10
11
12
:Lbl Count
:0→r3
:pt-Get(r1,r2)
:For(8)
:{→r1}
:While
:Select(,r3ʳ++) and (-1) .subtract not negative
:End
:r1+1
:End
:Return r3
Logged
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #1462 on: 08 April, 2012, 17:49:22 »
0

I suppose you could use bit arithmetic with a pointer to a Pt-Get('ed sprite. I'm not too clear on how that would work though.
If it's byte-aligned, he could even work with the bytes directly, instead of using Pt-Get(. With that said, the fastest way to find the number of set bits in a byte (which is a necessary part of this) is almost certainly a look-up table. Yes, it's 256 bytes, but it's far faster than any bit arithmetic you can do.
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
mrmprog
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 28 September, 2012, 05:58:25
Date Registered: 15 February, 2011, 01:35:36
Location: Somewhere
Posts: 559


Total Post Ratings: +34

View Profile
« Reply #1463 on: 08 April, 2012, 20:08:20 »
0

Thanks. I have another one:If I have four numbers, and one will be zero, what is the fastest way to find the next smallest number?
Logged

calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #1464 on: 08 April, 2012, 22:06:10 »
0

If exactly one number will be zero and the numbers aren't sorted in any way, I'm pretty sure the best way is to go through them with a variable containing the minimum value, while ignoring zeroes.
Here, for example, is some code that will give the minimum non-zero value in the first 100 bytes of L1 in M (And -1 if they're all 0):

1
2
3
4
5
6
7
8
-1->M
L1->X
For(100
If ({X}->V<M)?V=/=0
V->M
End
X++
End
There's probably a more optimized way to write that, but it should work.
If there could be more than one zero, the essence of what you have to do is have a flag that records whether you've already encountered one zero.
Edit: Runer112 wins by far. The method I've proposed would work better across lots of values (perhaps at least 10) than across 4.
« Last Edit: 09 April, 2012, 21:25:15 by calcdude84se » Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 02:12:15
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1465 on: 09 April, 2012, 05:47:21 »
0

If it's only four numbers, the fastest way would be a couple of nested min() commands, like this.


1
2
min(min(A-1,B-1),min(C-1,D-1))+1

EDIT: Actually, I'm not entirely sure if this will work how you want it to. It depends whether or not you want 0 as a result if two or more of the values are 0. For instance, if the numbers were 0, 0, 1, 2, this routine would return 1.
« Last Edit: 09 April, 2012, 05:52:55 by Runer112 » Logged
parserp
Hero Extraordinaire
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 00:32:08
Date Registered: 08 September, 2011, 02:01:43
Location: Here.
Posts: 1421


Total Post Ratings: +80

View Profile WWW
« Reply #1466 on: 17 April, 2012, 03:57:10 »
0



How do I achieve this? (program image and text)
Logged

ticalc.org | Cemetech | TI-Freakware | casiocalc.org

My New Website!
Spoiler for The Rest:



A useful tool
Spoiler for bands:
Five Finger Death Punch
Disturbed
Slipknot
Linkin Park
Avenged Sevenfold
Breaking Benjamin
Skillet
30 Seconds to Mars
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1467 on: 17 April, 2012, 03:58:36 »
0

I'm pretty sure you can do the image with one of the axe command that I don't remember. (Something like #Image or something?)
but text, I have no clue.
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 02:12:15
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1468 on: 17 April, 2012, 04:02:54 »
0

To quote the documentation:

Quote from: Documentation.pdf
The next thing you absolutely need is an Axe Header. You must start the first line with a
period, which is a comment in Axe, followed by the name you want for the compiled
program. If you want a program description, you can type a space and then the
description on that same line, but this is optional. In the above example your program
might look like this:


1
2
3
PROGRAM:MARIOSRC
:.MARIO A fun platformer
:

And to quote the commands list:

Quote
#Icon(HEX) Key: identity()   Tells the parser to replace the default icon with the new icon. The icon must be 64 hex characters long.
Logged
parserp
Hero Extraordinaire
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 00:32:08
Date Registered: 08 September, 2011, 02:01:43
Location: Here.
Posts: 1421


Total Post Ratings: +80

View Profile WWW
« Reply #1469 on: 17 April, 2012, 04:04:14 »
0

Ah. That makes sense. Thanks! Cheesy
Logged

ticalc.org | Cemetech | TI-Freakware | casiocalc.org

My New Website!
Spoiler for The Rest:



A useful tool
Spoiler for bands:
Five Finger Death Punch
Disturbed
Slipknot
Linkin Park
Avenged Sevenfold
Breaking Benjamin
Skillet
30 Seconds to Mars
Pages: 1 ... 96 97 [98] 99 100 ... 110   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.204 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.