DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦36b4fd45d⟧ TextFile

    Length: 2620 (0xa3c)
    Types: TextFile
    Names: »B«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦306851c02⟧ 
                └─⟦this⟧ 

TextFile

separate (Puz_Main)  
procedure Repaint_Number_Tiles is  
    Counter  : S_Natural;  
    Width    : S_Long;  
    Height   : S_Long;  
    X_Offset : S_Long;  
    Y_Offset : S_Long;

----cut the Tile_Window into a grid of nxn pieces by inscribing
--  each rectangle with a black border;
--  I don't want to use subwindows for each tile so that I can
--  slide groups of tiles together as a single unit, rather than
--  being forced to move one tile at a time.

    procedure Line (X1, Y1, X2, Y2 : S_Long) is  
    begin  
        X_Draw_Line (Dpy, Tile_Window.Drawable, Gc, S_Short (X1),  
                     S_Short (Y1), S_Short (X2), S_Short (Y2));  
    end Line;

    procedure Rect (X, Y : S_Long) is  
    begin  
        Line (Ulx (X, Y), Uly (X, Y), Urx (X, Y), Ury (X, Y));  
        Line (Urx (X, Y), Ury (X, Y), Lrx (X, Y), Lry (X, Y));  
        Line (Lrx (X, Y), Lry (X, Y), Llx (X, Y), Lly (X, Y));  
        Line (Llx (X, Y), Lly (X, Y), Ulx (X, Y), Uly (X, Y));  
    end Rect;

begin

    Height   := S_Long (Tile_Font_Info.Ascent + Tile_Font_Info.Descent);  
    Y_Offset := S_Long ((Tile_Height - Height) / 2 +  
                        S_Long (Tile_Font_Info.Ascent));

    X_Set_Font (Dpy, Gc, Tile_Font_Info.Font_Id);

    Counter := 0;  
    for I in 0 .. Puzzle_Height - 1 loop  
        for J in 0 .. Puzzle_Width - 1 loop  
            declare  
                Im : constant String := S_Natural'Image (Position (Counter));  
            begin  
                if Position (Counter) = 0 then  
                    Rect_Set (Tile_Window, Ulx (J, I), Uly (J, I),  
                              Tile_Width, Tile_Height, Fg_Pixel);

                else  
                    Rect_Set (Tile_Window, Ulx (J, I), Uly (J, I),  
                              Tile_Width, Tile_Height, Bg_Pixel);  
                    Rect (J, I);  
                    Width := S_Long  
                                (X_Text_Width (Tile_Font_Info,  
                                               To_X_String (Im (Im'First + 1 ..  
                                                                   Im'Last))));  
                    X_Offset := (Tile_Width - Width) / 2;  
                    X_Draw_String (Dpy, Tile_Window.Drawable, Gc,  
                                   S_Short (Ulx (J, I) + X_Offset),  
                                   S_Short (Uly (J, I) + Y_Offset),  
                                   To_X_String (Im (Im'First + 1 .. Im'Last)));  
                end if;  
            end;  
            Counter := Counter + 1;  
        end loop;  
    end loop;

end Repaint_Number_Tiles;