• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Evaluated] [Assignment] Week 1, Week 2

Status
Not open for further replies.
Thank you for submitting this assignment.

  • In Practice Lesson 4, x is only an integer if it were defined as integer x, so you don't really know.
  • In Practice Lesson 6, although you called the functions with correct syntax, you left them inside the comment, so the compiler ignored them completely.
  • Same applies to lesson 7. In lesson 7, however, you have mistakes. GetTriggerUnit is incorrect to have as an expression because it's simply a name of a function. You forgot the () at the end of it. It should be GetTriggerUnit(). This also applies to GetPlayableMapRect() and AddHeroXp. Also, in the 4th part, you shouldn't have used the call keyword inside the line. call only goes at the beginning of the line. You can't have it in the middle.
  • In Practice Lesson 8, hexadecimal numbers are represented by using 0x as a header. $ can be used, but I really wouldn't recommend doing it because in vJASS, it's reserved as an operator for textmacros :v. Unicode is not a correct classification. Hexadecimal is.
    Here's a full answer key:
    JASS:
    /*
    *
    *       1.  07214
    *
    *           octal
    *           
    *               binary:         0b111010001100
    *               octal:          07214
    *               decimal:        3724
    *               hexadecimal:    0xE8C
    *
    *       2.  1421
    *
    *           decimal
    *
    *               binary:         0b10110001101
    *               octal:          0o2615
    *               decimal:        1421
    *               hexadecimal:    0x58D
    *
    *       3.  0x3493
    *
    *           hexadecimal
    *
    *               binary:         0b11010010010011
    *               octal:          0o32223
    *               decimal:        13459
    *               hexadecimal:    0x3493 
    *
    *       4.  4211
    *
    *           decimal
    *
    *               binary:         0b1000001110011
    *               octal:          0o10163
    *               decimal:        4211  
    *               hexadecimal:    0x1073
    *
    *       5.  0x5F1
    *
    *           hexadecimal
    *
    *               binary:         0b10111110001
    *               octal:          0o2761
    *               decimal:        1521
    *               hexadecimal:    0x5F1 
    *
    *       6.  'hfoo'
    *
    *           ascii
    *
    *               call PrintInteger('hfoo')
    *               run map
    *               gives 1751543663
    *
    *               binary:         0b1101000011001100110111101101111
    *               octal:          0o15031467557
    *               decimal:        1751543663
    *               hexadecimal:    0x68666f6f
    *
    *       7.  032
    *
    *           octal
    *
    *               binary:         0b11010
    *               octal:          032
    *               decimal:        26
    *               hexadecimal:    0x1A
    *
    *       8.  91.5
    *
    *           decimal
    *
    *               binary:         0b1011011.1000
    *               octal:          0o133.40
    *               decimal:        91.5
    *               hexadecimal:    0x5B.8
    *
    *       9.  0b1011101
    *
    *           binary
    *
    *               binary:         0b1011101
    *               octal:          0o135
    *               decimal:        93
    *               hexadecimal:    0x5D
    *
    *       10. 0o305
    *
    *           octal
    *
    *               binary:         0b11000101
    *               octal:          0o305
    *               decimal:        197
    *               hexadecimal:    0xC5
    *
    */
  • In Practice Lesson 10, the correct answers are No, No, No, Yes. Reals in Warcraft III are very inaccurate :v. The last one is only right because of how you forced the decimal places to have a certain value.
  • Project 1 was never complete :v
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Second map. Didn't get an answer to using / or " inside strings.
Also, some of it might be good for practice, but handing out complicated tasks makes it more tedious for me than useful. Don't know about others though.
 

Attachments

  • vJASS Student W2.w3m
    21.2 KB · Views: 9
Evaluation:

Code:
Lesson 11

        Good job
        
Lesson 12

        Failed
        
            Incorrect output
            You cannot use bj_lastCreatedUnit.
            vJASS is not magic. You need to set the unit into a variable,
            and use that variable. That is how bj_lastCreatedUnit works.
            When you create a unit in GUI, you would be calling BJ functions.
            Those functions set bj_lastCreatedUnit to whatever unit is being 
            created. Nothing magical about it.
        
Lesson 13

        Failed
        
            Try again
            
            An integer drops the decimals, it does not round
            
            If there is a real and an integer together, the output is a real, not
            an integer
            
            Keeping these ideas in mind and then see what kind of answers you get
        
Lesson 14

        Failed
        
            *   Verify position 999, which wasn't set, is 0
            
            Position 999 is 0, not 999
            
            As you got incorrect output here, this means that you put the wrong values in for the
            positions.
            
            Keep in mind the difference between a position and index. Recall player id vs player number.
        
Lesson 14 P2

        Failed
        
            When running the map, you won't see the rifleman as you set the incorrect position
            
            Keep in mind the difference between a position and an index
        
Lesson 15

        Failed
        
            "12345"             -> 12345 -> (3 + 6) -> 12945 -> "12945"
            
            Convert the string into an integer
            Retrieve the 3 out of that integeer
            Add 6 to the 3
            Combine back with integer (the left side and right side)
            Convert the completed integer back into a string
        
Lesson 16

        Failed
        
            Check lesson 16 on escape characters
            
            It states that tabs don't work. You still need to get the
            spacing, so just use spaces
            
            "    " works doesn't it?
            
            You also forgot the "->"
        
Lesson 17

        Failed
        
        You displayed the first one correctly, but you forgot the second one.
        
Lesson 19

        Failed
        
            Once again, keep in mind the difference between a position and an index
        
            Also, could have just used "9"
            
            This was the expected code:
            
            globals
                string array spaz
            endglobals

            //! runtextmacro Function()
                set spaz[13] = "9"
                
                call Print(R2S(S2I(spaz[13])))
            //! runtextmacro End_Code()
        
Project 2

        Failed
 
Status
Not open for further replies.
Top