Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -0,0 +1,9 @@
|
|||
If2[test1_, test2_, condBoth_, cond1_, cond2_, condNone_] := With[
|
||||
{result1 = test1,
|
||||
result2 = test2},
|
||||
Which[
|
||||
result1 && result2, condBoth,
|
||||
result1, cond1,
|
||||
result2, cond2,
|
||||
True, condNone]];
|
||||
SetAttributes[If2, HoldAll];
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
x = 0;
|
||||
If2[Mod[(++x), 2] == 0, Mod[x, 3] == 1, Print["Both: ", x], Print["First: ", x], Print["Second: ", x], Print["Neither: ", x]];
|
||||
If2[Mod[(++x), 2] == 0, Mod[x, 3] == 1, Print["Both: ", x], Print["First: ", x], Print["Second: ", x], Print["Neither: ", x]];
|
||||
If2[Mod[(++x), 2] == 0, Mod[x, 3] == 1, Print["Both: ", x], Print["First: ", x], Print["Second: ", x], Print["Neither: ", x]];
|
||||
If2[Mod[(++x), 2] == 0, Mod[x, 3] == 1, Print["Both: ", x], Print["First: ", x], Print["Second: ", x], Print["Neither: ", x]];
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
if2[c1_,c2_]:=Which[
|
||||
c1&&c2, bothConditionsAreTrue[],
|
||||
c1, firstConditionIsTrue[],
|
||||
c2, secondConditionIsTrue[],
|
||||
True,noConditionIsTrue]
|
||||
Loading…
Add table
Add a link
Reference in a new issue