JASS: Moving From GUI to Jass, the Start

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
yeah u make me more understand about return
+rep
_______
SPREADING xIDS
 
H

Hjalle

Guest
Im a total beginner at JASS (almost really), so this helped me alot. Good tutorial. At last i understand the return, takes things :p

+rep and 5 stars :)
 

l46kok

TH.net Regular
Reaction score
6
on your tutorial, you introduced an example about multiplying function

JASS:
function multiply takes integer a, integer b returns integer
    local variable counter = 1
    loop
        exitwhen counter > b
        set a = a + a
        set counter = counter + 1
    endloop
    return a
endfunction


Suppose the parameter given for this code is

a = 3
b = 3

which the result should return 9 right?

However, if you actually run the code, you would get 12 if you examine the loop since a gets a + a

First loop : 3 + 3 = 6
Second loop : 6 + 6 = 12
Third loop : Counter = b, loop exits here

You might want to make some changes :D

Sorry about double post. I thought that you should include a warning about global variables.

In any practice of computer programming (Yes, this includes JASS), it is almost always a good idea to avoid global variables. They are usually considered bad practice precisely because of their nonlocality: a global variable can potentially be modified from anywhere, and any part of the program may depend on it. A global variable therefore has an unlimited potential for creating mutual dependencies, and adding mutual dependencies increases complexity.

Furthermore, the use of global variables makes software harder to read and understand. Since any code anywhere in the program can change the value of the variable at any time, understanding the use of the variable may entail understanding a large portion of the program. They can lead to problems of naming because a global variable makes a name dangerous to use for any other local or object scope variable.

Well I suppose, in a few cases, global variables can be suitable for use. For example, they can be used to avoid having to pass frequently-used variables continuously throughout several functions.

But the bottom line is, unless if you are absolutely sure that having a global variable would be advantageous in your code, avoid using them.

P.S : (I do not understand why JASS tutorials here do not emphasize this enough. This is a crucial matter in programming).
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Very nice spotting about the function, I will fix it right a way. Thanks!

As for global variables, I agree with you completely, most people agree that locals are better then globals, and locals should be used if possible.
 

Naminator

Coming Back To Life
Reaction score
76
It really made me saw Jass in a different way. Help me a lot!

+Rep. Really good tutorial!
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Great tutorial, it was really helpfull.

Actually, isn't JASS similar to Visual Basic?
People say it is, I have no idea, I never bothered learning C++.

~Gals~, yes locals, if used correctly make a good MUI spells.

So, mods / admins, what's happening with this tutorial, is it approved or disapproved?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
no idea...many tut just scattered around...+rep and push to 5stars :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
875
> So, mods / admins, what's happening with this tutorial, is it approved or disapproved?

Well, at least it's not in the Graveyard yet. :p

> you could get rid of the center alignment from the table of contents and use the default font, as well. Makes easier to read.

I DO agree with that. Somewhat. I think you should make the headers for each of the sections larger and maybe bold, then make the sub-headings beneath them smaller. Also, you might add a blank line between each big section.
 

Tinki3

Special Member
Reaction score
418
>is it approved or disapproved?

I vote for approval.
-Long, and explanatory
-Useful
-Adds to the 'JASS Tutorial' collection(*)

>at least it's not in the Graveyard yet

Wait, AceHart's lurking around the corner!
Joking :p

(*) Wait, that is a good thing, right?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
875
> I vote for approval.

Is there a poll on it? :p Make it happen, then.

I agree. The content certainly warrants approval.
 

Weebl

New Member
Reaction score
5
Very nice tut. I've read a few but they all manage to make even the most basic things look really scary. This however was really comprehensive and made it perfectly clear to me just how simple JASS actually is to learn.

O and by the way I disagree with all the people who say this is too long. Although I don't like unneccessarily drawn-out tuts, this one only takes half an hour (maximum) to read and it teaches you ALL the basics. As far as I'm concerned anyone who isn't willing to spend half an hour learning a comlpete new set of tools shouldn't call himself a modder.
 

cowmenace

New Member
Reaction score
22
I knew absolutely nothing about jass, custom scripts, I was hardcore GUIer I took this tutorial I understand functions, loops, ifthenelse, and so much more that looked like gibberish. Only took me about 1 hr to get thnx u r awesome!!!!!
 

mr_fj

New Member
Reaction score
10
OMG OMG OMG Thank you so much. If you havn't written this, i would never have begun learning Jass. Thx +rep (and maybe next time i see you post somewhere, because of this toturial ^^)

Thanks.























Thanks again :D



















Last time: THANKS!!!! THX THANK'U XD XD XD
 
M

MeRn00b

Guest
WoW, Thats truly a 11 of 10
Goodbye GUI, Hello JASS
+Rep
You really, really did create, it's like >:eek:< just simply amazing

~My thought is, lucky me, for waiting to learn JASS~
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Sunday!
    +1
  • The Helper The Helper:
    I will be out of town until Sunday evening
    +1
  • The Helper The Helper:
    I am back! Did you miss me LOL
    +1
  • jonas jonas:
    where did you go?
  • The Helper The Helper:
    Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
    +1
  • The Helper The Helper:
    It was a lot of fun. The RV was bad ass
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top