示例#1
0
        /* Return a random hint from the global hints list */
        public static string random_hint()
        {
            Hint v = null, r = null;
            int  n;

            for (v = Misc.hints, n = 1; v != null; v = v.next, n++)
            {
                if (Random.one_in_(n))
                {
                    r = v;
                }
            }
            return(r.hint);
        }
示例#2
0
        /* Initialise hints */
        public static Parser.Error parse_hint(Parser p)
        {
            Hint h = p.priv as Hint;
            Hint newh = new Hint();

            newh.hint = p.getstr("text");
            newh.next = h;

            p.priv = newh;
            return Parser.Error.NONE;
        }