Ejemplo n.º 1
0
 IStoryThread passage2_Main()
 {
     Vars.str = "A";
     macros2.assert(Vars.str == "A", "equality (left)");
     macros2.assert("A" == Vars.str, "equality (right)");
     macros2.assert(Vars.str != "ABC", "inequality (left)");
     macros2.assert("ABC" != Vars.str, "inequality (right)");
     Vars.str = Vars.str + "B";
     macros2.assert(Vars.str == "AB", "join operator (left)");
     Vars.str = "C" + Vars.str;
     macros2.assert(Vars.str == "CAB", "join operator (right)");
     macros2.assert(Vars.str.Contains("CA"), "contains literal");
     macros2.assert(Vars.str["1st"] == "C", "position fwd");
     macros2.assert(Vars.str["2ndlast"] == "A", "position bkwd");
     macros2.assert(Vars.str[(3)] == "B", "numeric index fwd");
     macros2.assert(Vars.str[(-1)] == "A", "numeric index bkwd");
     macros2.assert(Vars.str[macros1.a(1, 3)] == "CB", "index array (substring)");
     macros2.assert(Vars.str["length"] == 3, "length");
     macros2.assert(v("Fear").Contains(("e" + "ar")), "contains expression");
     macros2.assert(v("ugh").ContainedBy("Through"), "contained by");
     macros2.assert(v("YO")["1st"] == "Y", "position fwd");
     macros2.assert(v("YO")["last"] == "O", "position bkwd");
     macros2.assert(v("PS")[(2)] == "S", "numeric index");
     macros2.assert(v("1st").AsMemberOf[("YO")] == "Y", "reverse position fwd");
     macros2.assert(v("last").AsMemberOf[("YO")] == "O", "reverse position bkwd");
     macros2.assert(v(2).AsMemberOf[("PS")] == "S", "numeric index");
     macros2.assert(macros1.substring("cheese", 2, 4) == "hee", "macro substring");
     macros2.assert(macros1.text(4 * 80) == "320", "text macro");
     macros2.pass();
     yield break;
 }
    IStoryThread passage2_Main()
    {
        Vars.@var = Vars.@var + 1;
        yield return(lineBreak());

        macros3.ExportVar("var");
        yield return(lineBreak());

        Vars.disp = "Value is: " + macros1.text(Vars.@var);
        yield return(lineBreak());

        yield return(text(Vars.disp));

        yield return(lineBreak());

        yield return(link("Continue.", "Loop", null));

        yield return(lineBreak());

        yield return(link("Be done.", "End", null));

        yield break;
    }