• 🏆 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!

[Evaluated] [Assignment] Week 2

Status
Not open for further replies.
Level 2
Joined
Jul 20, 2010
Messages
11
In project 2 i am not sure if i completely understand the instructions. Its says:
JASS:
//Unit may be a value
//Is A may be a value
//[ ] may be a value
//-> may be a value
//" " may be a value

What do you mean by that they may have value? And what is Is A? Haven't seen that in any lesson. So kind of confusing where it came from.

And we may only use 5 once if i understand correctly except for the direct writes. So we need to find a way to get values, 11, 56 and 421 from variables and the value 5? We looking for some pattern or something?

EDIT: I attached week 2. This is how i solved it. It works but probably not the most effecient code.

EDIT2: New, better version of Project 2 :D
 

Attachments

  • vJASS Student W2.w3m
    21 KB · Views: 10
Last edited:
Your lessons will be evaluated as soon as possible, thank you for your submission.

When we say "Is A may be a value", we mean that you can use the string "Is A" directly as a value in your code. We mean the same thing for other parts as well.
Thank you for commenting on that. These kinds of things help us improve the maps.

And we may only use 5 once if i understand correctly except for the direct writes. So we need to find a way to get values, 11, 56 and 421 from variables and the value 5? We looking for some pattern or something?

Yes. Arithmetic ;)
I'll give you a hint:

11 = 5 + 5 + 5/5

You have to now find a way to get the values 56 and 421 represented in similar fashions.
 
Level 2
Joined
Jul 20, 2010
Messages
11
Yes. Arithmetic ;)
I'll give you a hint:

11 = 5 + 5 + 5/5

You have to now find a way to get the values 56 and 421 represented in similar fashions.

Thanks a lot for the hint! :D I talked to Nestharus and my Project 2 is incorrect in fact. I will upload better version just now.

Thanks for looking at it!

Cheers
 
Code:
Lesson 11

	Pass

Lesson 12

	Pass

Lesson 13

	Pass

Lesson 14

	Pass

Lesson 14 P2

	Pass

Lesson 15

	Pass

		In case you're interested, for the third part of the problem, 
		this is the solution we had in mind:

		set original = S2I(str3)
		set modRight = original - original/100*100
		set mod = original/100
		set mod = mod - mod/10*10
		set mod = mod + 6
		set original = (original/1000*10 + mod)*100 + modRight
		call Print(I2S(original))
		
Lesson 16

	Pass

Lesson 17

	Pass

Lesson 19

	Pass

Project 2

	Fail

		You are told to use the value 5 only once, but you used it more than once.
		You were expected to use arithmetic to derive the other numbers.
		You know that K/K = 1 and you have access to the *, +, - and / operators, so 
		it shouldn't have been very difficult.

		Other than that, you did well.

Grade: 7/10
 
Level 2
Joined
Jul 20, 2010
Messages
11
Yeah, i had submitted Project 2 and then Nestharus told me where my faults were. I solved them eventually but i didnt know what the policy was about handing in assignments that had already been looked at. Not that it matters, I solved them eventually myself and i am happy with a 7 :D. Cheers
 
Status
Not open for further replies.
Top