Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
24 May, 2013, 17:43:49 *
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 ... 25 26 [27] 28 29 ... 42   Go Down
  Print  
Author Topic: Routines -  (Read 42573 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #390 on: 27 August, 2010, 05:07:09 »
0

That said, it is very possible to do cool stuff with the old functions already. A lot of the new stuff that got added is much more low level or technical, like fixed points, which I never got able to understand, even with the tutorials. I still recommend using the latest Axe, though, for optimization and safety.

Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« Reply #391 on: 04 September, 2010, 20:27:28 »
+3

By the way, I think I forgot to mention during the last update the additional uses for the inData() command because its more powerful than it looks.

First thing, yes, it can be used to find the position of a character in a string:

1
inData('I',"IGNITION")->L

To find the second, third, etc. instance of 'I', you could loop through this.

1
inData('I',"IGNITION"+L)->L

This moves the pointer to the spot directly after the last character found so it starts looking at the 'G' until it gets to the end.

Another use for this is to see if a number is part of a specific group.  The only problem with this is that 0 is always found at the end since its the terminating character.  So you should check for 0 before using the inData() command usually.  Another thing to mention is that inData() only works with bytes so make sure you guarantee that your input is restricted to numbers between 0 to 255 or -128 to 127.


1
2
3
4
5
6
7
8
9
10
11
12
.Inefficient
If (A=3 or (A=5) or (A=20) or (A=28) or (A=61))
.Some code
End

.Efficient
If A
  If inData(A,Data(3,5,20,28,61,0))
  .Some code
  End
End
This is probably unnoticeable slower, but its much smaller and the routine is a subroutine so using it more than once in your program will definitely be a large size optimization.
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
LordConiupiter
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 11 March, 2012, 00:00:11
Date Registered: 22 March, 2010, 18:14:33
Location: the Netherlands
Posts: 338


Total Post Ratings: +3

View Profile
« Reply #392 on: 04 September, 2010, 20:36:50 »
0

wow! nice hint! I myself wouldn't have thought of it. I'm really gonna use this.
Logged

everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:

1
2
3
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one Wink )   Cheesy click me, and you'll be raided Cheesy
coolsnake
LV2 Member (Next: 40)
**
Offline Offline

Last Login: 09 November, 2011, 20:28:48
Date Registered: 27 August, 2010, 18:41:29
Posts: 36

Total Post Ratings: +2

View Profile
« Reply #393 on: 04 September, 2010, 22:14:19 »
0

Ow just the thing I needed, thank you Cheesy
Logged

Unpretty Integrals
This program gives you a graphical representation of the "fnint(" function, which allows you to calculate definite integrals. It is extremely similar to the functionality MathPrint provides, minus the extreme bloat that slows your calculator down to a crawl.
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 12:50:02
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #394 on: 04 September, 2010, 22:24:42 »
0

Wow, looks like the inData is a really powerful command!  Im going to have to use this now in all of my programs Cheesy
Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #395 on: 05 September, 2010, 01:49:37 »
0

Nice, that could become useful eventually Smiley
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #396 on: 08 September, 2010, 01:57:31 »
0

Wow, inData( is pretty useful...
Logged




ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 22 May, 2013, 03:10:30
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5687


Total Post Ratings: +360

View Profile
« Reply #397 on: 29 September, 2010, 22:08:42 »
+3

I've seen some people wanting to use Text input routines, so here's the one I use in Axe Snake, SpiderAx, and Jump.  Press Second when done typing, del to backspace, and Clear to quit.
At the end of the routine, the string is null terminated and begins at L1.  It also Displays it again because I wanted to show how to display it and waits for you to press second again. Smiley

If you use this routine, you may credit me, but it is not necessary. Grin

* TYPENAME.8xp (0.54 KB - downloaded 156 times.)
Logged

ACagliano
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 14 May, 2013, 13:02:38
Date Registered: 03 July, 2009, 01:06:06
Posts: 764


Total Post Ratings: +29

View Profile WWW
« Reply #398 on: 30 September, 2010, 00:02:06 »
0

Is there a length limit on the input?
Logged

-ACagliano
TI-Basic software developer

My Website


Current Projects
----------------------------
1. Legend of Zelda "Revenge of Ganon"
        -maps: 100%
        -graphics engine: 20% (sprites)
        -AI engine: 0%
        -event scripts: 60% (text left)
        -walking engine: 100%
        -miscellaneous: 40%
  -total progress:  54%

ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 22 May, 2013, 03:10:30
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5687


Total Post Ratings: +360

View Profile
« Reply #399 on: 30 September, 2010, 00:50:21 »
0

Yes.  There's a comment in the source just before the line that would need to be changed. Smiley
Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #400 on: 30 September, 2010, 05:40:08 »
0

Wow nice! Thanks a lot for this. Smiley
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
shmibs
bonsai bok choy wiseguy waterboy
Administrator
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Last Login: Today at 07:20:24
Date Registered: 11 June, 2010, 19:36:15
Location: 89B6
Posts: 1851


Total Post Ratings: +238

View Profile
« Reply #401 on: 30 September, 2010, 07:40:03 »
0

/\Very! thanks
since i havent seen one put out for display yet, here is a smoothscrolling tilemapper(works for left/right and up/down)
this is also partially for my own benefit because i have a lot riding on this routine and if there's anywhere it can be optimized it would be nice to know =D

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
:0->A->BClrDraw
:For(L,0,11:For(M,0,7
:Pt-on(L*8,M*8,{M*[MapWidth]+8+[MapData]}*8+[TileData]
:End:End
:StorePic
:Repeat getkey(15)
:If getkey(3) xor getkey(2)
::If getkey(3)
:Horizontal -
:For(L,0,8
:Pt-Off(95-(A^8),L*8-(B^8),{B/8+L*[MapWidth]+12+(A/8)+[MapData]}*8+[TileData]
:End:A+1->AElse
:Horizontal +
:For(L,0,8
:Pt-Off(1-(A^8),L*8-(B^8),{B/8+L*[MapWidth]+(A/8)+[MapData]}*8+[TileData]
:End:A-1->AEnd
:End
:If getkey(1) xor getkey(4)
:If getkey(1)
:Vertical -
:For(L,0,12
:Pt-Off(L*8-(A^8-(A^8),63-(B^8),{B/8+8*[MapWidth]+L+(A/8)+[MapData]}*8+[TileData]
:End:B+1->BElse
:Vertical+
:For(L,0,12
:Pt-Off(L*8-(A^8),1-(B^8),{B/8*[MapWidth]+L+(A/8)+[MapData]}*8+[TileData]
:End:B-1->BEnd
:End
:Dispgraph
:End
this can be easily converted to do gray as well, although you shouldn't use vertical scrolling and the axe grayscale routines together as the result will look gross. also, make sure that A and B remain greater than 0, or you'll end up with errors
« Last Edit: 10 November, 2010, 05:37:50 by shmibs » Logged



We're not human, are we?
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #402 on: 30 September, 2010, 07:46:06 »
0

Nice! I assume I can try this right away with no other code?

EDIT: You should maybe post a 8xp or SourceCoder-compatible code, because I do not feel like typing everything out x.x
« Last Edit: 30 September, 2010, 07:46:38 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
shmibs
bonsai bok choy wiseguy waterboy
Administrator
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Last Login: Today at 07:20:24
Date Registered: 11 June, 2010, 19:36:15
Location: 89B6
Posts: 1851


Total Post Ratings: +238

View Profile
« Reply #403 on: 01 October, 2010, 03:55:11 »
0

well, you do need a tileset(8*8 monochrome) and map data(anything larger than 13*9) as well, but all the code is there, yes.
if you really want one i can post an .8xp tomorrow-ish. i have work to do right now, though.
Logged



We're not human, are we?
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #404 on: 01 October, 2010, 04:11:06 »
0

Ah ok, I guess I could quickly do a map or something when I have some time.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: 1 ... 25 26 [27] 28 29 ... 42   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.397 seconds with 31 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.