Ejemplo n.º 1
0
        def figure(frame):
            fig = PyFig(size=(550,400), frame_num=frame, y=25, name_right=230, val_gap=75)

            n_nums = fig.auto_name("nums")
            l_nums = fig.list(texts=["1", "2", "3"], pos=fig.val_for_name(n_nums), set=8, fade=1)
            fig.reference(n_nums, l_nums[0])

            the_frame = fig.frame(pos=fig.next_frame(), size=(230,200), text="augment_twice_bad", rise=2, set=7, fade=1)
            n_a_list = fig.auto_name("a_list", rise=2, set=5)
            fig.reference(n_a_list, l_nums[0])
            n_val = fig.auto_name("val", rise=2, set=6, fade=1)
            i_val = fig.int(pos=fig.val_for_name(n_val), text="7", rise=2, set=6, fade=1)
            fig.reference(n_val, i_val)

            n_a_list = fig.name(center=n_a_list.center, size=n_a_list.size, text="a_list", rise=5, set=6, fade=1)
            l_a_list = fig.list(texts=["1", "2", "3", "7", "7"], pos=fig.val_for_name(n_a_list), rise=4)
            fig.reference(n_a_list, l_a_list[0])

            n_return = fig.name(center=(the_frame.right, n_a_list.cy), size=(25,25), text="", rise=6, set=8)
            fig.reference(n_return, l_a_list[0])

            n_nums = fig.name(center=n_nums.center, size=n_nums.size, text="nums", rise=8)
            fig.reference(n_nums, l_a_list[0])

            cog.outl(fig.tostring())
Ejemplo n.º 2
0
        def figure(frame):
            fig = PyFig(size=(500,400), frame_num=frame, y=25, name_right=200, val_gap=75)

            n_x = fig.auto_name("x", set=2)
            n_hidden = fig.auto_name("", set=0)
            s_hello = fig.string(pos=fig.val_for_name(n_x), size=(120,50), text=repr("hello"), set=2, fade=1)
            fig.reference(n_x, s_hello)
            n_x = fig.name(center=n_x.center, size=n_x.size, text="x", rise=2)
            s_hello = fig.string(pos=fig.val_for_name(n_hidden), size=(120, 50), text=repr("world"), rise=2)
            fig.reference(n_x, s_hello)

            cog.outl(fig.tostring())
Ejemplo n.º 3
0
        def figure(frame):
            fig = PyFig(size=(500,400), frame_num=frame, y=25, name_right=200, val_gap=75)

            n_x = fig.auto_name("x", set=4)
            n_y = fig.auto_name("y", rise=2)
            s_hello = fig.string(pos=fig.val_for_name(n_y), size=(120,50), text=repr("hello"))
            fig.reference(n_x, s_hello)
            fig.reference(n_y, s_hello)
            s_there = fig.string(pos=fig.val_for_name(n_x), size=(200, 50), text=repr("hello there"), rise=3)
            n_x = fig.name(center=n_x.center, size=n_x.size, text="x", rise=4)
            fig.reference(n_x, s_there)
            cog.outl(fig.tostring())
Ejemplo n.º 4
0
        def figure(frame):
            fig = PyFig(size=(500,400), frame_num=frame, y=25, name_right=200, val_gap=75)

            n_x = fig.auto_name("x", set=3)
            i_23 = fig.int(pos=fig.val_for_name(n_x), text="23", set=2)
            fig.reference(n_x, i_23)
            fig.next_name()  # Burn a name to space them out.
            n_y = fig.auto_name("y", rise=2)
            c_23 = (n_x.cy + n_y.cy) / 2
            i_23 = fig.int(left=(fig.val_left, c_23), text="23", rise=2)
            fig.reference(n_x, i_23)
            fig.reference(n_y, i_23)

            n_x = fig.name(center=n_x.center, size=n_x.size, text="x")
            i_12 = fig.int(pos=fig.val_for_name(n_x), text="12", rise=3)
            fig.reference(n_x, i_12)

            cog.outl(fig.tostring())