Quantcast

Maximum PC

It is currently Tue Jul 29, 2014 10:31 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Jass?
PostPosted: Sat Apr 19, 2008 12:43 pm 
Team Member
Team Member
User avatar

Joined: Sun Jun 12, 2005 5:52 pm
Posts: 1319
Location: Infront of my Computer.
I was looking over some code in Jass, and was wondering how this would work.

Code:
function SaveLoad_Id2CId takes integer n returns integer
    local integer i = n / (256 * 256 * 256)
    local integer r
    set n = n - i * (256 * 256 * 256)
    set r = udg_SaveLoad_Compress[i]
    set i = n / (256 * 256)
    set n = n - i * (256 * 256)
    set r = r * 64 + udg_SaveLoad_Compress[i]
    set i = n / 256
    set r = r * 64 + udg_SaveLoad_Compress[i]
    return r * 64 + udg_SaveLoad_Compress[n - i * 256]
endfunction


If I set n to lets say, 35, wouldn't it just divide it by 256 cubed, set n to 0 based on the math it created, set i to 0, then set n to 0 overwriting its 0 again, set i to 0 again also, and just defeat the purpose of the second set of set i and n's that set them to 0 a second time. Or does it set them, and when it reaches a set r, redoes the local's and goes back to where it left off?


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group