Compare two revisions of: RandadjustIf

... ... @@ -63,7 +63,7 @@ You may call randadjustIf multiple times to adjust *disjoint* lists of variables
63 63 \end{question}
64 64 ```
65 65 <div class="alert green">
66 - You should *NEVER* adjust the same variable twice. The following example might lead to problems:
66 + You should *NEVER* adjust a variable that has impact to the constraint of a previous `\randadjustIf`. The following example might lead to problems:
67 67 </div>
68 68
69 69 ```LaTeX
... ... @@ -74,8 +74,9 @@ You may call randadjustIf multiple times to adjust *disjoint* lists of variables
74 74 \randint[Z]{y}{-10}{10}
75 75 \randint[Z]{c}{-10}{10}
76 76 \randint[Z]{d}{-10}{10}
77 - \randadjustIf{x,y}{x <= y} %adjust x and y if x is not greater than y
78 - \randadjustIf{c,x}{c = d OR c = x} % here the variable x will be re-adjusted
77 + \function[calculate]{x2}{x+2}
78 + \randadjustIf{y}{x2 <= y} %adjust y if x+2 is not greater than y
79 + \randadjustIf{c,x}{c = d OR c = x} % here the variable x will be re-adjusted, the value of x2 changed
79 80 % and the constraint from previous randadjustIf might be broken.
80 81 \end{variables}
81 82
... ... @@ -92,5 +93,3 @@ manner as explained above, also multiple times for disjoint sets of global varia
92 93 global variables within a question, but only in the problem environment where they are defined.
93 94
94 95 [Alternatively use a switch/case statement](Variables.md#switchcase-statements)
95 -
96 -
97 96