text stringlengths 0 234 |
|---|
BEGIN |
for carril IN T_Carril loop |
FOR I IN T_RangoBufferCoches LOOP |
Coche.Id := 0; |
Coche.Pos.X := 0; |
Coche.Pos.Y := y_carril(carril); |
coche.velocidad := (VELOCIDAD_COCHE, 0); |
Coche.Color:= T_ColorCoche'First; |
coche.carril := carril; |
Pkg_Buffer_Coches.Actualiza_Item(i, Coche, Buffer_Coches(carril)); |
-- Inicializamos también el buffer de coches accidentados |
Pkg_Buffer_Accidentes.Actualiza_Item(i, Coche, Buffer_Accidentes(carril)); |
END LOOP; |
END LOOP; |
exception |
when event: others => |
PKG_debug.Escribir("ERROR en Inicializar_Buffer_Coches: " & Exception_Name(Exception_Identity(event))); |
end Inicializar_Buffer_Coches; |
------------------------------------------------------------------------ |
-- Función que devuelve la posición de un coche dentro del buffer |
----------------------------------------------------------------------- |
FUNCTION Posicion_Buffer(Id : T_IdCoche; |
Buffer: Pkg_Buffer_Coches.T_Buffer) RETURN T_RangoBufferCoches is |
coche_aux : T_RecordCoche; |
pos : T_RangoBufferCoches; |
BEGIN |
BEGIN |
Pos := Pkg_Buffer_Coches.Posicion_Primer_Item(Buffer); |
Coche_Aux := Pkg_Buffer_Coches.Consulta_Item(Pos, Buffer); |
WHILE Coche_Aux.Id /= Id LOOP |
Pos := Pos+1; |
Coche_Aux := Pkg_Buffer_Coches.Consulta_Item(Pos, Buffer); |
END LOOP; |
exception |
when event: others => |
PKG_debug.Escribir("ERROR en Posicion_Buffer: " & Exception_Name(Exception_Identity(event))); |
Function Definition: procedure Wsl_Launch is |
Function Body: -- Ada_Launch is the default name, but is meant to be renamed |
-- to the executable name that this executable launches |
package Env renames Ada.Environment_Variables; |
package CL renames Ada.Command_Line; |
package CLenv renames Ada.Command_Line.Environment; |
-- Env, CL, and CLenv are just abbreviations for: |
-- Environment_Variables, Command_Line, and Command_Line.Environment |
package AdaList is |
new Ada.Containers.Indefinite_Doubly_Linked_Lists (String); |
function Exec_In_Path (Exec_Name : String) return String is |
begin |
if not (Locate_Exec_On_Path (Exec_Name) = null) |
then |
return Locate_Exec_On_Path (Exec_Name).all; |
else |
Put_Line (Standard_Error, Exec_Name & " not found in PATH."); |
return ""; |
end if; |
Function Definition: procedure Startx is |
Function Body: -- XTerminal is a terminal bast in Xorg -- meant to be used as a login |
-- terminal. |
use GNAT.OS_Lib; |
package Env renames Ada.Environment_Variables; |
package Cl renames Ada.Command_Line; |
package Files renames Ada.Directories; |
package Os renames GNAT.OS_Lib; |
package Os_Files renames GNAT.Directory_Operations; |
package Regex renames GNAT.Regpat; |
-- package OS renames gnat.os_lib; |
-- Env, CL, and CLenv are just abbreviations for: Environment_Variables, |
-- Command_Line, and Command_Line.Environment |
-- xterm -bg black -fg white +sb +sm -fn 10x20 -sl 4000 -cr yellow |
-- /usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker |
-- -display :1 |
Empty_Argument_List : constant Os.String_List (1 .. 0) := (others => null); |
Empty_List_Access : Os.String_List_Access := |
new Os.String_List'(Empty_Argument_List); |
function Image (Num : Natural) return String is |
N : Natural := Num; |
S : String (1 .. 48) := (others => ' '); |
L : Natural := 0; |
procedure Image_Natural |
(N : in Natural; |
S : in out String; |
L : in out Natural) is |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.