diff --git a/app/build.gradle b/app/build.gradle index 6876cf92..761b0414 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.duy.pascal.compiler" minSdkVersion rootProject.ext.minSdkVersion as Integer targetSdkVersion rootProject.ext.targetSdkVersion as Integer - versionCode 101 - versionName "4.0.1" + versionCode 102 + versionName "4.0.2" vectorDrawables.useSupportLibrary = true multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/libCompiler/src/main/assets/code_sample/crt/color_argb.pas b/libCompiler/src/main/assets/code_sample/crt/color_argb.pas index 73278c38..a0ae9627 100644 --- a/libCompiler/src/main/assets/code_sample/crt/color_argb.pas +++ b/libCompiler/src/main/assets/code_sample/crt/color_argb.pas @@ -2,15 +2,27 @@ Uses Crt; var - generator : android_graphics_Color; - a, color : integer; + generator : android_graphics_Color; + a, color : integer; Begin - for a := 0 to 25 do - begin - color := generator.argb(a, 0, 0, 255); - textBackground(color); //ARGB color - write(' '); - end; - ReadLn; + for a := 0 to 255 do + begin + color := generator.argb(a, 0, 0, 255); + textBackground(color); //ARGB color + write(' '); + end; + for a := 0 to 255 do + begin + color := generator.argb(a, 0, 255, 0); + textBackground(color); //ARGB color + write(' '); + end; + for a := 0 to 255 do + begin + color := generator.argb(a, 255, 0, 0); + textBackground(color); //ARGB color + write(' '); + end; + ReadLn; End. diff --git a/sample/BlackJack-Pascal-master/README.md b/sample/BlackJack-Pascal-master/README.md deleted file mode 100644 index d0abe300..00000000 --- a/sample/BlackJack-Pascal-master/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# BlackJack-Pascal -A version of the famous card game Blackjack written in Pascal. - -Instructions to run it: - -1- Compile: ``` fpc blackjack.pas ``` - -2- Execute: ```./blackjack``` diff --git a/sample/BlackJack-Pascal-master/blackjack.pas b/sample/BlackJack-Pascal-master/blackjack.pas deleted file mode 100644 index ca43bbc4..00000000 --- a/sample/BlackJack-Pascal-master/blackjack.pas +++ /dev/null @@ -1,656 +0,0 @@ -Program blackjack; -(* Herrero Arnanz, Javier *) -(* Tejero de Pablos, Miguel Angel *) -(* Enero 2010 - Programacion I - UVa *) - -(*Programa que permite al usuario jugar una serie de partidas de una versión simplificada del BlackJack*) - -USES - crt; - -(*Libreria para usar los subprogramas delay, clrscr y readkey*) - -CONST - MaxCartas = 52;(*Numero de cartas de la baraja*) - -TYPE - Tvalor = 0..11; - - (*Representa los valores de cada carta*) - (*El cero es para inicializar las bazas*) - - Ttam_baraja = 1..MaxCartas; - -(*Representa el tamaño de una baraja*) - - Tcartas = Record - carta : String[4]; - valor : Tvalor; - end; - -(*Representa cada una de las cartas de la baraja*) - - Tbaraja = ARRAY[Ttam_baraja] of Tcartas; - -(*Representa la baraja*) - - Tbaza = ARRAY[1..11] of Tcartas;(*Representa las cartas del jugador y el casino*) - (*Como mucho se necesitaran 11 cartas, pues con 11 se obtiene una puntacion igual o mayor de 21*) - - - - -(*FUNCIONES Y PROCEDIMIENTOS*) - -Procedure crea_baraja (Var baraja : Tbaraja); -(*Se crea una baraja con las cartas agrupadas por palos*) -(*Sera necesario barajarla antes de comenzar a jugar*) -(*Los ases se inicializan con valor 11*) -Var - i : Integer; -(*Indice para recorrer toda la baraja*) - card : Integer; -(*Representa la carta que se va ha crear en cada momento*) - cadena : String[2];(*Variable auxiliar para el paso de entero a cadena*) -Begin - card := 1; (*Comenzamos con un 'as'*) - For i:=1 to MaxCartas do - Begin - If (card > 13) then card := 1; (*Cuando hemos completado un palo,pasamos al siguiente*) - Case card of - 1 : - Begin - baraja[i].carta := '[A]'; - baraja[i].valor := 11; - end; - 2..10 : - Begin - str(card, cadena); (*Pasamos a cadena la carta para poder guardarla en la baraja*) - baraja[i].carta := '[' + cadena + ']'; - baraja[i].valor := card; - end; - 11 : - Begin - baraja[i].carta := '[J]'; - baraja[i].valor := 10; - end; - 12 : - Begin - baraja[i].carta := '[Q]'; - baraja[i].valor := 10; - end; - 13 : - Begin - baraja[i].carta := '[K]'; - baraja[i].valor := 10; - end; - - end; - - card := (card + 1); - end; -end; - -(*crea_baraja*) - - - - - -Procedure barajar (Var baraja : Tbaraja); -(*Se barajan las cartas de la baraja pasada como argumento*) -Var - i : Integer; -(*Indice para recorrer toda la baraja*) - carta_aux : Tcartas; -(*Variable auxiliar para poder hacer el intercambio de cartas*) - posic : Integer;(*Posicion a la que se mueve la carta*) - -Begin - (*Recorremos la baraja cambiando aleatoriamente la posicion de las cartas*) - (*Para ello intercambiamos la carta en la que nos encotramos por otra carta situada*) - (*en una poscicion obtenida aleatoriamente*) - For i:=1 to MaxCartas do - Begin - posic := Random(52) + 1; (*Calculamos la posicion aleatoriamente*) - - (*Realizamos el intercambio usando para ello la variable auxiliar*) - carta_aux.carta := baraja[posic].carta; - carta_aux.valor := baraja[posic].valor; - baraja[posic].carta := baraja[i].carta; - baraja[posic].valor := baraja[i].valor; - baraja[i].carta := carta_aux.carta; - baraja[i].valor := carta_aux.valor; - end; - -end; - -(*barajar*) - - - - - -Procedure imprime_reglas (Var opc : Char); -(*Imprime por pantalla las reglas e instrucciones del juego*) -(*Al final se le pide al usuario que elija entre jugar o salir, la opcion eligida*) -(*se almacena en 'opc' y se le pasa al programa principal para que se conozca la eleccion*) -Begin - Clrscr; - Writeln(''); - Writeln(' ------------------------'); - Writeln(' |REGLAS E INSTRUCCIONES|'); - Writeln(' ------------------------'); - Writeln(''); - Writeln('- El BlackJack se juega con una baraja de 52 cartas, con 4 palos,'); - Writeln(' cada palo consta de un ás, 3 figuras (J,Q,K) y cartas numeradas del 2 al 10.'); - Writeln(' Las cartas numeradas tienen un valor igual a su número, las figuras cuentan '); - Writeln(' como 10 y los ases como 1 o 11, según le convenga al jugador.'); - Writeln(''); - Writeln('- El propósito del juego es conseguir una serie de cartas cuyo valor total sea'); - Writeln(' el máximo posible pero sin superar el valor 21 (que se denomina BlackJack y '); - Writeln(' es la mejor jugada).'); - Writeln(''); - Writeln('- El desarrollo de una partida del juego es el siguiente: '); - Writeln(''); - Writeln(' 1) APUESTA INICIAL: Siempre de 2 euros.'); - Writeln(' 2) REPARTO INICIAL: Dos cartas al jugador y una al casino.'); - Writeln(' 3) SERIE DEL JUGADOR: El jugador va pidiendo nuevas cartas hasta que '); - Writeln(' se plante, obtenga un blackjack (21), o se pase (supere el valor 21).'); - Writeln(' Al pedir una nueva carta tiene la opción de doblar la apuesta.'); - Writeln(''); - Writeln(' Si el jugador ha obtenido un blackjack o se ha pasado se omite el paso '); - Writeln(' siguiente (el casino no pide cartas).'); - Writeln(''); - Writeln(' 4) SERIE DEL CASINO: Independientemente del valor obtenido por el jugador, '); - Writeln(' el casino va pidiendo nuevas cartas hasta que sumen un valor >= a 17.'); - Writeln(' 5) EVALUCACION DEL RESULTADO:'); - Writeln(' -Si el jugador tiene blackjack gana y el casino le paga 3/2 de la apuesta.'); - Writeln(' -Si el jugador se ha pasado pierde.'); - Writeln(' -Si el jugador no se ha pasado y el casino sí, el jugador gana.'); - Writeln(' -Si ambos no se han pasado, gana el que tenga una baza de valor mayor,'); - Writeln(' o bien el casino en caso de empate.'); - Writeln(''); - Writeln(''); - Write('¿ Desea [J]ugar o [S]alir ?: [J/S] '); - Repeat - opc := Readkey; - until (opc = 'j') or (opc = 's'); - -end; - -(*imprime_reglas*) - - - - - -Procedure inicializar_baza (Var baza : Tbaza); -(*Inicializa a cero la baza que se le pase como argumento*) -(*Las cadenas que simbolizan las cartas, se inicializan con el caracter '0'*) -Var - i : Integer;(*Indice*) -Begin - For i:=1 to 11 do - Begin - baza[i].carta := '0'; - baza[i].valor := 0; - end; -end; - -(*inicializar_baza*) - - - - - -Procedure balance_global (par, apu, bal : Integer); -(*Muestra por pantalla el numero de partida, apuesta, balance*) -Begin - Writeln('Partida: ', par, '| Apuesta: ', apu, '| Balance: ', bal); -end; - -(*balance_global*) - - - - - -Procedure estado_partida (baza_cas, baza_jug : Integer; cart_cas, cart_jug : Tbaza; ret_cas, ret_jug : Boolean); -(*Muestra por pantalla las cartas del casino y el jugador*) -Var - i : Integer;(*Indice*) -Begin - Writeln('-----------------------------------------------------------'); - (*Se muestra la baza del casino*) - Write('Casino '); - If (ret_cas) then Delay(1000); - If (baza_cas < 10) then - Write('( ', baza_cas, ') ') - else - Write('(', baza_cas, ') '); - (*Se muestran las cartas del casino*) - i := 1; - While (i <= 11) do - Begin - If (cart_cas[i].carta <> '0') then - Begin - If (ret_cas) then Delay(1000); (*Entre que se muestra cada carta esperamos 1 segundos*) - Write(cart_cas[i].carta, ' '); - end - else - Begin - i := 11; (*Cuando encontremos un cero ya no quedaran cartas por mostrar*) - end; - - i := (i + 1); - end; - Writeln(''); - (*Se muestra la baza del jugador*) - Write('Jugador '); - If (ret_jug) then Delay(1000); - If (baza_jug < 10) then - Write('( ', baza_jug, ') ') - else - Write('(', baza_jug, ') '); - (*Se muestran las cartas del jugador del mismo modo que las del casino*) - i := 1; - While (i <= 11) do - Begin - If (cart_jug[i].carta <> '0') then - Begin - If (ret_jug) then Delay(1000); (*Entre que se muestra cada carta esperamos 1 segundos*) - write(cart_jug[i].carta, ' '); - end - else - Begin - i := 11; - end; - - i := (i + 1); - end; - Delay(1000); - Writeln(''); - Writeln('------------------------------------------------------------'); -end; - -(*estado_partida*) - - - - - -Procedure robar_carta (Var baraja, retiradas : Tbaraja; Var baza : Tbaza; Var card : Ttam_baraja); -(*Se roba una carta de la baraja y esta se incluye en la baza especificada*) -(*Ademas la carta robada se elimina de la baraja y pasa al monton de retiradas*) -Var - pos_baza : 1..11; -(*Contiene el indice de la baza donde colocaremos la carta robada*) - i : Integer;(*Indice*) -Begin - pos_baza := 1; - (*Buscamos una posicion de la baza donde no exista carta alguna*) - While (baza[pos_baza].valor <> 0) do - Begin - pos_baza := (pos_baza + 1); - end; - (*Colocamos la carta en la baza*) - baza[pos_baza].carta := baraja[card].carta; - baza[pos_baza].valor := baraja[card].valor; - (*Pasamos la carta al monton de retiradas*) - retiradas[card].carta := baraja[card].carta; - retiradas[card].valor := baraja[card].valor; - (*Eliminamos la carta de la baraja*) - baraja[card].carta := '0'; - baraja[card].valor := 0; - (*Comprobamos si se ha agotado el monton de reparto*) - If (card = 1) then - Begin - (*El monton de reparto toma las cartas del monton de retiradas y lo barajamos*) - baraja := retiradas; - barajar(baraja); - (*Limpiamos el monton de retiradas*) - For i:=1 to MaxCartas do - Begin - retiradas[i].carta := '0'; - retiradas[i].valor := 0; - end; - (*Actualizamos el apuntador de carta*) - card := MaxCartas; - end - else - (*Actualizamos el apuntador de carta para la sig. vez q se robe*) - card := (card - 1); -end; - -(*robar_carta*) - - - - - -Function tiene_ases(c : Tbaza) : Boolean; -(*Devuelve true si encuentra ases con valor 11*) -Var - i : Integer;(*Indice*) -Begin - i := 1; - While (i <= 11) do - Begin - If (c[i].valor <> 0) then - Begin - If (c[i].valor = 11) then - Begin - tiene_ases := True; - i := 13; - end - else - Begin - i := (i + 1); - end; - end - else - i := 12; - end; - - If (i = 12) then tiene_ases := False; -end; - -(*tiene_ases*) - - - - - -Procedure valor_ases(Var baz : Integer; Var cart : Tbaza); -(*Evalua la baza y cartas pasadas como parametros por variable y en caso de que la baza supere el valor 21*) -(*y se posean ases, estos pasan ha tener valor 1*) -Var - i : Integer; -Begin - If (baz > 21) and (tiene_ases(cart)) then - Begin - i := 1; - While (i <= 11) do - Begin - If (cart[i].valor = 11) then - Begin - cart[i].valor := 1; - baz := (baz - 10); - i := 12; - end - else - Begin - i := (i + 1); - end; - end; - end; -end; - -(*valor_ases*) - - - - - - - -(*VARIABLES DEL PROGRAMA PRINCPAL*) -VAR - monton_reparto, monton_retiradas : Tbaraja; - (*Monton de cartas pendientes de repartir / Monton de cartas ya repartidas*) - cartas_jugador, cartas_casino : Tbaza; - (*Almacena las cartas que va recibiendo el jugador y el casino*) - partida, apuesta, balance : Integer; -(*Contador de partidas / Contador de apuestas / Balance de ganancias y perdidas del jugador*) - opcion : Char; -(*Almacena las elecciones hechas por el jugador a lo largo de la partida *) - apuntador_carta : Ttam_baraja; -(*Contiene el indice de la carta que queremos robar*) - baza_casino, baza_jugador : Integer; -(*Contiene la baza en cada momento del casino y del jugador respectivamente*) - serie_casino : Boolean; -(*Indica si se ejecuta o no la serie del casino*) - ganada : Boolean; - (*Indica si el jugador ganó la partida o no*) - t : integer; -(*Indice*) - enter : Char; -(*Almacena la tecla enter cuando la pulsa el jugador*) - retardo_cas, retardo_jug : Boolean;(*Indica si activamos los retardos o no, al mostrar la baza y las cartas del casino o el jugador*) - - - - - -(*CUERPO DEL PROGRAMA PRINCIPAL*) -BEGIN - Randomize; - Clrscr; (*Limpiamos la pantalla*) - apuntador_carta := MaxCartas; (*Inicializamos el apuntador de carta con la carta de la cima del monton*) - - (*Impresion de la pantalla de inicio del juego*) - Writeln(''); - Writeln(' ---------------------------------------------'); - Writeln(' | *** [21] *** BLACKJACK *** [21] *** |'); - Writeln(' ---------------------------------------------'); - Writeln(''); - Writeln(''); - Writeln(' 1- Reglas e instrucciones'); - Writeln(' 2- Jugar'); - Writeln(' 3- Salir'); - Writeln(''); - Writeln(''); - Write('Escoja una opcion: '); - - (*Leemos la opcion elegida y la ejecutamos*) - Repeat - opcion := Readkey; - until (opcion = '1') or (opcion = '2') or (opcion = '3'); - - - If (opcion = '1') then imprime_reglas(opcion); - - (*Si recibimos un '2' o bien una 'j' (despues de haber imprimido las reglas) sabemos que*) - (*debemos comenzar el juego, en caso contrario se termina la ejecucion del programa*) - If (opcion = '2') or (opcion = 'j') then - Begin - (*Generamos el monton de reparto y barajamos las cartas*) - crea_baraja(monton_reparto); - barajar(monton_reparto); - - (*Inicializamos el contador de partida y balance*) - partida := 1; - balance := 0; - - - (*BUCLE PRINCIPAL EN EL QUE CADA ITERACION REPRESENTA UNA PARTIDA JUGADA*) - Repeat - Clrscr; - (*Inicializamos el contador de apuesta*) - apuesta := 2; - (*Repartimos dos cartas al jugador*) - inicializar_baza(cartas_jugador); - inicializar_baza(cartas_casino); - For t:=1 to 2 do - robar_carta(monton_reparto, monton_retiradas, cartas_jugador, apuntador_carta); - - (*Repartimos una carta al casino*) - robar_carta(monton_reparto, monton_retiradas, cartas_casino, apuntador_carta); - retardo_cas := True; - retardo_jug := True; (*Activamos los retardos al mostrar las cartas para el reparto inicial*) - - (*SERIE DEL JUGADOR*) - Repeat - (*Actualizamos las bazas del casino y el jugador*) - baza_casino := 0; - baza_jugador := 0; - For t:=1 to 11 do - Begin - baza_casino := (baza_casino + cartas_casino[t].valor); - baza_jugador := (baza_jugador + cartas_jugador[t].valor); - end; - - (*Comprobamos la baza para saber que valor deben tomar los ases(si los hay)*) - valor_ases(baza_jugador, cartas_jugador); - (*Mostramos el estado de la partida*) - balance_global(partida, apuesta, balance); - estado_partida(baza_casino, baza_jugador, cartas_casino, cartas_jugador, retardo_cas, retardo_jug); - (*Despues de el reparto inicial solo aplicamos retardo al jugador*) - retardo_cas := False; - retardo_jug := True; - (*Evaluamos la baza obtenida*) - If (baza_jugador >= 21) then - Begin - If (baza_jugador = 21) then - Begin - Write('BLACKJACK! (Pulse ENTER)'); - Repeat - enter := Readkey; - until (enter = #13); - Writeln(''); - opcion := 'p'; - serie_casino := False; - ganada := True; - (*Incrementamos el balance en 3/2 de la apuesta actual*) - apuesta := ((apuesta div 2) * 3); - balance := (balance + apuesta); - end - else - Begin - Write('SE PASO! (Pulse ENTER)'); - Repeat - enter := Readkey; - until (enter = #13); - Writeln(''); - opcion := 'p'; - serie_casino := False; - ganada := False; - (*Decrementamos al balance la apuesta actual*) - balance := (balance - apuesta); - end; - end - else - Begin - (*Si no se paso ni consiguio blackjack le mostramos las opciones*) - Write('[O]tra carta, [P]lantarse, [D]oblar: [O/P/D] '); - Repeat - opcion := Readkey; - until (opcion = 'o') or (opcion = 'p') or (opcion = 'd'); - Case opcion of - 'o' : - Begin - robar_carta(monton_reparto, monton_retiradas, cartas_jugador, apuntador_carta); - clrscr; - end; - 'd' : - Begin - robar_carta(monton_reparto, monton_retiradas, cartas_jugador, apuntador_carta); - apuesta := (apuesta * 2); - Clrscr; - end; - 'p' : - Begin - serie_casino := True; - end; - end; - end; - - until (opcion = 'p'); (*Serie del jugador*) - - - - - (*SERIE DEL CASINO*) - While (serie_casino) do - Begin - Writeln(''); - (*El casino roba una carta*) - robar_carta(monton_reparto, monton_retiradas, cartas_casino, apuntador_carta); - - (*Actualizamos la baza del casino*) - baza_casino := 0; - For t:=1 to 11 do - Begin - baza_casino := (baza_casino + cartas_casino[t].valor); - end; - - (*En la serie del casino solo retardamos el reparto de cartas del casino*) - retardo_cas := True; - retardo_jug := False; - valor_ases(baza_casino, cartas_casino); - estado_partida(baza_casino, baza_jugador, cartas_casino, cartas_jugador, retardo_cas, retardo_jug); - If (baza_casino >= 17) then - Begin - If (baza_casino <= 21) then - Begin - Writeln('Casino se planta'); - Delay(1500); - end - else - Begin - Writeln('Casino se paso'); - Delay(1500); - ganada := True; - (*Incrementamos el balance con la apuesta actual*) - balance := (balance + apuesta); - end; - serie_casino := False; - end - else - Begin - Writeln('Casino pide otra carta'); - Delay(1500); - serie_casino := True; - end; - end; (*Serie del casino*) - - - - (*RESULTADO FINAL DE LA PARTIDA*) - If (baza_jugador > baza_casino) and (baza_jugador < 21) then - Begin - ganada := True; - balance := (balance + apuesta); - end; - - If (baza_casino > baza_jugador) and (baza_casino <= 21) then - Begin - ganada := False; - balance := (balance - apuesta); - end; - If (baza_jugador = baza_casino) then - Begin - ganada := False; - balance := (balance - apuesta); - end; - - If ganada then - Begin - Writeln(''); - Write('GANASTE (+', apuesta, ') '); - Delay(1000); - end - else - Begin - Writeln(''); - Write('PERDISTE (-', apuesta, ') '); - Delay(1000); - end; - - (*MENSAJE DE FINAL DE PARTIDA*) - Write('Otra ronda? [S/N]'); - Repeat - opcion := Readkey; - until (opcion = 's') or (opcion = 'n'); - - partida := (partida + 1); (*Actualizamos el contador de partida*) - - until (opcion = 'n'); (*partida*) - - - end; - - Clrscr; (*Limpiamos la pantalla al salir del programa*) - -END.(*Fin programa principal*) diff --git a/sample/Pascal-Labyrinth-Game-master/LICENSE b/sample/Pascal-Labyrinth-Game-master/LICENSE deleted file mode 100644 index 9cecc1d4..00000000 --- a/sample/Pascal-Labyrinth-Game-master/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/sample/Pascal-Labyrinth-Game-master/README.md b/sample/Pascal-Labyrinth-Game-master/README.md deleted file mode 100644 index 4cf2e62f..00000000 --- a/sample/Pascal-Labyrinth-Game-master/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Pascal-Labyrinth-Game - - -Игра написанная мной в 2007 году, как попытка "укрепить" свои знания в программировании. - - -Суть игры простая: -* Необходимо собрать 3 цветных крестика, двигая "героя" по лабиринту. -* Максимум очков можно набрать сделав минимум ходов. - - - -# Системные требования: - - -* Среда разработки Turbo Pascal 7 -* Операционная система: Windows XP - - -# Демонстрация работы: - - -https://www.youtube.com/watch?v=Kp91eANiswk diff --git a/sample/Pascal-Labyrinth-Game-master/data.txt b/sample/Pascal-Labyrinth-Game-master/data.txt deleted file mode 100644 index 78d0f404..00000000 --- a/sample/Pascal-Labyrinth-Game-master/data.txt +++ /dev/null @@ -1,24 +0,0 @@ -0111111111111111111111111111111 -0111111000111111111111111111111 -0111111010111111111111111111110 -0000000010000000000000111111100 -0111111000111111111110111111101 -0000000011111111111110111000001 -1111111111111111111110001011111 -1111111111111111111111101011111 -1111111111111111111111101000111 -1111111111111111111111101101111 -1111111111111111111111100001111 -1111111111111100000000001111111 -1111111111111101111110111111111 -1111110000000000000000000000000 -1111110111111111111111111111110 -1111110111111111111111111111110 -1111110111111111111111111111110 -1111110111111111111111111110000 -1111110000000000000000000000111 -1111110111111111111111111110111 -1111110111111111111111111110111 -1111110111111111111111111110111 -0000000111111111111111111110000 -1111111111111111111111111111111 \ No newline at end of file diff --git a/sample/Pascal-Labyrinth-Game-master/data2.txt b/sample/Pascal-Labyrinth-Game-master/data2.txt deleted file mode 100644 index 9f19f476..00000000 --- a/sample/Pascal-Labyrinth-Game-master/data2.txt +++ /dev/null @@ -1,24 +0,0 @@ -0111111111111111111111111111111 -0111111111111000000001000000000 -0111111111111011111100011111110 -0000111000000000000111111111100 -1110111000111111111111111111101 -0000000011111111111111111000001 -1011111111111111111111111011111 -1011111111111111111111111011111 -1011111111111111111111111001111 -1000000000000000000000001101111 -1111101111111111111111100001111 -1111101111111100000000000111111 -1111101111111111111111111111111 -1111100000000000000000000000000 -1111110111111111111111111111110 -1111110111111111111111111111110 -1111110111111111111111111111110 -1111100111111111111111111110000 -1111101111111111111111100000111 -1111100111111111111111111110111 -1111110111111111111111111110111 -1111110111111111111111111110111 -0000000111111111111111111110000 -1111111111111111111111111111111 \ No newline at end of file diff --git a/sample/Pascal-Labyrinth-Game-master/data3.txt b/sample/Pascal-Labyrinth-Game-master/data3.txt deleted file mode 100644 index 9635da6d..00000000 --- a/sample/Pascal-Labyrinth-Game-master/data3.txt +++ /dev/null @@ -1,24 +0,0 @@ -0000000000000000000001111111110 -1111111111111111111101111000000 -1000100000000000000101111011110 -1010101111110111111101111011111 -1010101111110000000001111011111 -1010101111111111111111111011111 -1010001111000000000000000011111 -1011111111011111111111111111111 -1000000000011111110000000000011 -1111111111011111110111111111011 -1000001111011111110111111111011 -1011101111011111110111111111001 -1011100000011111110000000001101 -1011111111111111111111111101101 -1000000000000000000000000001101 -1111011111111111111111111111100 -1111011111111000111111111111110 -1111011111111010111110000011100 -1111000000000010111110111000001 -1111111111111110111110111111111 -1111111111111110111110000001111 -1100000000000000111111111101111 -0001111111111111111111111100000 -1111111111111111111111111111111 \ No newline at end of file diff --git a/sample/Pascal-Labyrinth-Game-master/new4.PAS b/sample/Pascal-Labyrinth-Game-master/new4.PAS deleted file mode 100644 index 5bd77b4d..00000000 --- a/sample/Pascal-Labyrinth-Game-master/new4.PAS +++ /dev/null @@ -1,342 +0,0 @@ -program new4; -uses crt, graph; - -type - ff = text; - - bn = array[1..24] of string[32]; - - point = object - A, B : integer; - procedure start; - - procedure clear (color : integer); - - procedure pt (v, d : integer); - - end; - - qa = object (point) - procedure move(x, y, color : integer); - - procedure d; - - end; - -procedure point.start; -begin - a := 2; - b := 2; -end; - -procedure point.pt (v, d : integer); -begin - putpixel (v, d, 15); -end; - -procedure point.clear (color : integer); -begin - setfillstyle (1, 0); - floodfill (a + 10, b + 10, 15); - setcolor(0); - rectangle (a, b, a + 20, b + 20); - setcolor(color); - setfillstyle (1, 15); -end; - -procedure qa.move (x, y, color : integer); -begin - setcolor(3); - setfillstyle (1, 0); - rectangle (a, b, a + 20, b + 20); - floodfill (a + 5, b + 5, 3); - setcolor(0); - rectangle (a, b, a + 20, b + 20); - setcolor(color); - a := a + x; - b := b + y; - if a > 602 then a := 602; - if a < 2 then a := 2; - if b > 462 then b := 462; - if b < 0 then b := 0; - rectangle (a, b, a + 20, b + 20); -end; - -procedure qa.d; -begin - setcolor (10); - rectangle (2, 2, 22, 22); -end; - -var - gd, gm : integer; - ch : char; - li : qa; - dx, dy, color : integer; - log, log2, log3 : ff; - mas : bn; - ab, bd, cd, t : byte; - sc : array[1..10] of integer; - -function setA (xs, ys : integer) : boolean; -var - fr : string; - rf : char; -begin - fr := mas[ys]; - if fr[xs] = '1' then setA := false - else setA := true; -end; - -function setB (xs, ys : integer) : boolean; -var - fr : string; - rf : char; -begin - fr := mas[ys]; - if fr[xs] = '1' then setB := false - else setB := true; -end; - -function setC (xs, ys : integer) : boolean; -var - fr : string; - rf : char; -begin - fr := mas[ys]; - if fr[xs] = '1' then setC := false - else setC := true; -end; - -function setD (xs, ys : integer) : boolean; -var - fr : string; - rf : char; -begin - fr := mas[ys]; - if fr[xs] = '1' then setD := false - else setD := true; -end; - -procedure MASSIV (var m : bn; var l : ff); -var - com : string[31]; - ij : integer; -begin - ij := 0; - reset(l); - while not eoln (l) do - begin - readln (l, com); - ij := ij + 1; - m[ij] := com; - end; - close(l); -end; - -procedure RIT (var m : bn); -var - tts, ttr : integer; - dfg : string; -begin - for tts:=1 to 31 do - for ttr:=1 to 23 do - begin - dfg := m[ttr]; - setfillstyle (1, t + 6); - if dfg[tts] = '1' then rectangle (tts * 20, ttr * 20, tts * 20 - 16, ttr * 20 - 16); - if dfg[tts] = '1' then floodfill (tts * 20 - 5, ttr * 20 - 5, white); - delay(200); - end; -end; - -procedure RIG; -var - h : integer; -begin - setfillstyle (1, t + 6); - for h:=0 to 22 do - begin - rectangle (624, 20 * h + 4, 639, 20 * h + 20); - floodfill (625, 20 * h + 10, white); - delay(3000); - end; - for h:=0 to 30 do - begin - rectangle (20 * h + 4, 464, 20 * h + 20, 479); - floodfill (20 * h + 6, 470, white); - delay(3000); - end; - rectangle (624, 464, 639, 479); - floodfill (625, 465, white); -end; - -procedure WINER (var ch : char; dx, dy : integer; var ab, bd, cd : byte); -begin - if (dx = 31) and (dy = 3) then - begin - ab := 1; - color := 13; - end; - if (dx = 1) and (dy = 23) then - begin - bd := 1; - color := 14; - end; - if (dx = 31) and (dy = 23) then - begin - cd := 1; - color := 9; - end; - if ab + bd + cd = 3 then ch := #13; -end; - -procedure OCH1; -begin - setlinestyle (0, 0, 3); - setcolor (14); - line (6, 444, 18, 460); - line (18, 444, 6, 460); - setcolor (9); - line (606, 444, 618, 460); - line (618, 444, 606, 460); - setcolor (13); - line (606, 44, 618, 60); - line (618, 44, 606, 60); - setlinestyle (0, 0, 1); -end; - -procedure OCH2 (sc : array of integer); -var - qwe : boolean; -begin - clrscr; - qwe := true; - gotoxy (10, 7); - textcolor (red); - if sc[0] <> 0 then writeln ('Level 1: ', 1 / sc[0] * 10000: 0 : 0, ' Points') - else begin - qwe := false; - writeln ('Level 1: FAILED'); - end; - gotoxy (10, 8); - if sc[1] <> 0 then writeln ('Level 2: ', 1 / sc[1] * 10000: 0 : 0, ' Points') - else begin - qwe := false; - writeln ('Level 2: FAILED'); - end; - gotoxy (10, 9); - if sc[2] <> 0 then writeln ('Level 3: ', 1 / sc[2] * 10000: 0 : 0, ' Points') - else begin - qwe := false; - writeln ('Level 3: FAILED'); - end; - if qwe = true then - begin - gotoxy (20, 15); - textcolor (128 + 10); - writeln ('!!!!! SUPER WINER !!!!!'); - end; - readln; -end; - -begin - t := 1; - repeat - color := 10; - dx := 1; - dy := 1; - - if t = 1 then - begin - assign(log, 'data.txt'); - massiv (mas, log); - end; - - if t = 2 then - begin - assign(log2, 'data2.txt'); - massiv (mas, log2); - end; - - if t = 3 then - begin - assign(log3, 'data3.txt'); - massiv (mas, log3); - end; - - ab := 0; - bd := 0; - cd := 0; - t := t + 1; - - gd := detect; - gm := 0; - InitGraph(gd, gm, ''); - if graphresult = grOK then - begin - rit(mas); - rig; - li.start; - li.d; - och1; - repeat - ch := readkey; - if ch = #0 then - begin - ch := readkey; - case ch of - #72 : if setA(dx, dy - 1) then - begin - li.move(0, -20, color); - if dy > 1 then - begin - dy := dy - 1; - sc[t - 1] := sc[t - 1] + 1; - end; - end; - #80 : if setB(dx, dy + 1) then - begin - li.move(0, 20, color); - if dy < 24 then - begin - dy := dy + 1; - sc[t - 1] := sc[t - 1] + 1; - end; - end; - #75 : if setC(dx - 1, dy) then - begin - li.move(-20, 0, color); - if dx > 1 then - begin - dx := dx - 1; - sc[t - 1] := sc[t - 1] + 1; - end; - end; - #77 : if setD(dx + 1, dy) then - begin - li.move(20, 0, color); - if dx < 31 then - begin - dx := dx + 1; - sc[t - 1] := sc[t - 1] + 1; - end; - end; - end; - end; - winer (ch, dx, dy, ab, bd, cd); - until ch = #13; - end; - closegraph; - textcolor(129 + t); - gotoxy(36, 10); - if ab + bd + cd = 3 then - begin - write ('!!!WIN!!!'); - readln; - end - else sc[t - 1] := 0; - until t = 4; - och2(sc); - readln; -end. \ No newline at end of file diff --git a/sample/game-in-pascal-master/.gitattributes b/sample/game-in-pascal-master/.gitattributes deleted file mode 100644 index bdb0cabc..00000000 --- a/sample/game-in-pascal-master/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/sample/game-in-pascal-master/.gitignore b/sample/game-in-pascal-master/.gitignore deleted file mode 100644 index cd2946ad..00000000 --- a/sample/game-in-pascal-master/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk diff --git a/sample/game-in-pascal-master/JOGOCOMPLETO.pas b/sample/game-in-pascal-master/JOGOCOMPLETO.pas deleted file mode 100644 index 0a9986ed..00000000 --- a/sample/game-in-pascal-master/JOGOCOMPLETO.pas +++ /dev/null @@ -1,2914 +0,0 @@ -Program JOGOCOMPLETO; -uses crt; - -var - vida : integer; - // Contagem das Vidas disponíveis para o usuario - life : integer; - // Qtd. de HP disponível. - contvida : integer; - // Variável para contagem das vidas gastas á cada Ginásio e Pergunta. - cont : integer; - // Contador para Uso ou não das Ajuda dos Pokémons. - pok : integer; - // Contador para Qtd. de Uso dos Pokémons. - level : integer; - // Distribuidor de level para identificar o caso no GAME OVER . - pont : integer; - // Contador de Pontuação. - resto : integer; - // Resto da Pontuação caso perca vida, e ela seja menor que 500 - - nome : string[20]; - // Cadeia de Caracteres para Inserção do Nome . - verif : string[10]; - // Cadeia de Caracteres para Verificação da Disponibilidade da Pergunta. - resp : string[10]; - // Cadeia de Caracteres para Inserir a Resposta. - reiniciar : string[10]; // Cadeia de Caracteres para Reiniciar após o GAME OVER. - -// Procedimento do Corpo do Jogo -procedure JOGO; -Begin -// Atribuição de Valores - vida := 3; - life := 100; - pont := 0; -// Mudança de Cores -// Limpatela -// Interface - textbackground(red); - clrscr; - textcolor(1); - textcolor(12); - writeln(' --------_¦¦¦¦¦¦¦¦¦¦¦_--------'); - writeln(' -----_¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦_-----'); - writeln(' ----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----'); - writeln(' ---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---'); - writeln(' --¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--'); - writeln(' -¦¦¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦¦¦-'); - writeln(' ¦¦¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦'); - writeln(' ¦¦¦¦¦¦¦¦¦¦ ¦¦ ¦¦ ¦¦¦¦¦¦¦¦¦'); - writeln(' ¦¦¦¦¦¦¦¦¦ ¦¦ ¦¦¦¦ ¦¦ ¦¦¦¦¦¦¦¦'); - writeln(' ¦¦¦¦¦¦¦¦¦ ¦¦ ¦¦ ¦¦ ¦¦¦¦¦¦¦¦'); - textcolor(0); - writeln(' ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦'); - textcolor(15); - write(' ¦¦ ¦¦ ¦¦ ¦¦ ¦¦'); - writeln(' S S S SSSSSS'); - write(' ¦¦ ¦¦ ¦¦ ¦¦ '); - writeln(' S S S S '); - write(' ¦¦ ¦¦¦¦¦¦¦¦ ¦¦ '); - writeln(' S S S S '); - write(' -¦¦ ¦¦- '); - writeln(' S S S S '); - write(' --¦¦ ¦¦-- '); - writeln(' S S S S '); - write(' ---¦¦ ¦¦--- '); - writeln(' SSSSSS S SSSSSS'); - write(' ----¦¦¦ ¦¦¦---- '); - textcolor(14); - writeln(' > NOVO JOGO'); - textcolor(15); - writeln(' -----¯¦¦¦ ¦¦¦---- '); - write(' --------¯¦¦¦¦¦¦¦¦¦¦¦¦¦¦---- '); - textcolor(14); - writeln('PRESSIONE QUALQUER TECLA PARA INCIAR...'); - textcolor(15); - writeln(' ¦¦¦¦¦ '); - writeln(' ¦¦¦¦¦'); - writeln(' ¦¦'); - readkey; - // Mudança de Cor - - textcolor(white); - writeln(''); - write(' DIGITE SEU NOME DE TREINADOR : '); - read(nome); - // Entrada de Dados - clrscr; - // CAMPO DE REGRAS - writeln('------------------------------------------------------------------------------------------------------------'); - writeln(' REGRAS: '); - writeln('------------------------------------------------------------------------------------------------------------'); - writeln(' '); - writeln(' 1 - Cada GINÁSIO terá uma MATÉRIA, com uma série de PERGUNTAS para você responder. '); - writeln(' 2 - Por não ter pokebolas, você só pode usar UM pokémon por ginásio. '); - writeln(' 3 - Você perde HP (Pontos de vida) a cada resposta errada. '); - writeln(' 4 - Se o seu HP chegar a zero, você perde UMA VIDA , REINICIARÁ O GINÁSIO e perderá 500PTS. '); - writeln(' 5 - Sua pontuação consiste no seguinte : A cada Resposta CERTA = +100PTS. A cada Resposta ERRADA = -50PTS. '); - writeln(' 6 - Se você perder todas as 03 vidas, FIM DE JOGO. '); - writeln(' 7 - Seu objetivo final é derrotar os líderes de todos os ginásios, '); - writeln(' 8 - Se você acertar TODAS as perguntas, você obterá o pokémon mais raro de todos. '); - writeln(' 9 - Para usar seu Pokemon, basta digitar a Letra "P" no campo de respsta. '); - writeln(' 10- Todas as Perguntas contém 4 alternativas. Para responde-lás basta inserir o numéro da mesma (1,2,3,ou 4). '); - writeln(' 11 - Leia atentamente todos os Dialógos, pois eles terão informações importantes para o seu jogo. '); - writeln(' BOA SORTE! '); - writeln(''); - // MODO PARA PASSAR PARA PROX. TELA - writeln(' ***PRESSIONE QUALQUER TECLA PARA CONTINUAR...***'); - readkey; - - // Apresentação da primeira parte do jogo - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 A HISTÓRIA 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 Há tempos atrás, a bela ILHA de Aslândia era o lar de 8'); - writeln('8 vários pokémons, criaturas exóticas com poderes extraordinários, 8'); - writeln('8 que viviam em sua rica fauna e flora. 8'); - writeln('8 8'); - writeln('8 . :Fv 8'); - writeln('8 ..J7jUJ1i.7:q 8'); - writeln('8 qj,,X:.M:u.:UviJri 8'); - writeln('8 iE :: i rNuL,7i :,r. iS: 8'); - writeln('8 v. uri J2:0S1: . :G. .M. vii.YuLri 8'); - writeln('8 Mj7 F.vii@v: :j.: :r .E r7vLr.7Lj:F::ui 8'); - writeln('8 .;,L :Y :X.77k: 7:G ,:i J.LjZ i.,,,@ 8'); - writeln('8 S , YF: rLr.7, i. ii J..7G .2..5. rkBrYr:rr7v; 8'); - writeln('8 G,.7i i r Liu8OM :iM, L.,i.,.U.::0:7:i.,7v. 8'); - writeln('8 B .: :r: M7v, 0B 5r.iur.J :1: 7v:.. 8'); - writeln('8 @,7 ;Z iOiuS. ur:, i ,vYNrL 7 i.v.: 8'); - writeln('8 rk ;UZ77 :B rB, L; : 8'); - writeln('8 : ji ui L :ik7 2 :1 8'); - writeln('8 MY 7: ,LMr. 8'); - writeln('8 P j. v:Li 8'); - writeln('8 YJ kU 7.Lv 8'); - writeln('8 P.:1 i .Y 8'); - writeln('8 j :J@Bvi 8'); - writeln('8 .81Bu,.B1P@ 8'); - writeln('8 :v7: OM. . 5M:i7vri 8'); - writeln('8 .:::7vGGi :YGjv:,::: 8'); - writeln('8 rB7: ,0i:.:i7:. ..::,...i7vr7:,.:U7.::vk 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; - // Apresentação da segunda parte da historia do jogo - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 Porém, a fúria da natureza chegou a Aslândia,e após uma misteriosa 8'); - writeln('8 tempestade, a ilha afundou no oceano, onde ninguém poderia salvá-la. 8'); - writeln('8 Com a ilha, foram perdidos vários pokémons,uma dessas criaturas era 8'); - writeln('8 ARCHEN, uma bela ave-réptil multi-colorida. 8'); - writeln('8 8'); - writeln('8 .vi .:i777: 8'); - writeln('8 .::r :q0EOBOOOBOMMX 8'); - writeln('8 vMOGGB0i7iir7; 2BGrBBBMOZMBBB@B 8'); - writeln('8 rqBZ8G2,:::v: u@F J @MOO@B2B@B7 iijr 8'); - writeln('8 jX0XkZi :,:,ir BMu B@B@B8. JruiL,r: 8'); - writeln('8 7B0SGXkGNv,.:,J, PM8;,ZME:X0 .L:::ijG@OOE: 8'); - writeln('8 BMZFMv:r:,::2. 8PMBBNOq.Su L:,,..7OkEB8 8'); - writeln('8 :quJ@8@Bki7..,77: B@BOGBM@B@N ,u:,. rU2qXPMBY 8'); - writeln('8 :OP7:. iF. .::i@BBO@M@ijj::7v:::Yu7MN0O@ui: 8'); - writeln('8 B@SiS: j8MO@MB@M:.:i::7riLB@B@PL1: 8'); - writeln('8 .BBB@B:,...,::u.,:;r77: i7. 8'); - writeln('8 :vUNSr uukMOMO .,,... r 8'); - writeln('8 .j8@B@B@B@B@B@@@8@v .,,,..,q 8'); - writeln('8 .71FFPNZ8Mqi .qO@B@7::iii75. 8'); - writeln('8 r.iU5JUGN@ 8'); - writeln('8 @B uB. 8'); - writeln('8 E5EB@ @BqB@Ev 8'); - writeln('8 :51:J:, .Si::.: 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; -// Apresentação da terceira parte da historia do jogo - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 Por sorte ou por destino, você recebeu um ovo de Archen de seu avô, 8'); - writeln('8 que lhe dizia que este era o último da espécie, e assim você 8'); - writeln('8 acreditava... 8'); - writeln('8 Até o dia em que você viu o famoso Campeão da Liga Quiz Go!,carregando 8'); - writeln('8 nada mais, nada menos, que OUTRO ovo de Archen, fazendo um anúncio 8'); - writeln('8 que é exibido em todos os canais de televisão: 8'); - writeln('8 8'); - writeln('8 ,7rrrr: 8'); - writeln('8 rLi. .iLr 8'); - writeln('8 .Y, :u: 8'); - writeln('8 ij Lv 8'); - writeln('8 u@vP: .:. rJ 8'); - writeln('8 ;O::i@ 1qUk5 rL 8'); - writeln('8 .@i:::q7 8J::,@, Ui 8'); - writeln('8 ML7ri,8, :@vJjqi 5 8'); - writeln('8 7BirvvES ,ri: rXkvLi 8'); - writeln('8 GB0Pq0v :OSL7L@B 8'); - writeln('8 1 ,, 7B7r7rvY@ 8'); - writeln('8 ,2 B7r7vjjLB. 8'); - writeln('8 E .. 75Yr. :@7JjujJv@ 8'); - writeln('8 Oi. i@SN8MZ: ...MMujLLu@B 8'); - writeln('8 :G, :BLvYLSB: . LZGOOM@. 8'); - writeln('8 7qi SBESkq@, ... .:ii2: 8'); - writeln('8 ,1u:vPZZE:.,:::,:iLJ, 8'); - writeln('8 .7r7rr:irvLYj1jv. 8'); - writeln('8 .:::::.. 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; -// Apresentação da quarta parte da historia do jogo - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 "Treinadores de todo o mundo! Eu tenho aqui a última espécie do 8'); - writeln('8 Pokémon Archen! E ele será o prêmio daquele que derrotar todos os 8'); - writeln('8 líderes do meu ginásio QUIZ GO! Mas fiquem alerta! O perdedor terá 8'); - writeln('8 que ceder seu Pokémon mais valioso! QUE SE INICIE O DESAFIO!" 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 QQQ U U III ZZZZZ GGG OOO !!! 8'); - writeln('8 Q Q U U I Z G O O !!! 8'); - writeln('8 Q Q U U I Z G GG O O !!! 8'); - writeln('8 Q QQ U U I Z G G O O 8'); - writeln('8 QQQQ UUU III ZZZZZ GGG OOO !!! 8'); - writeln('8 Q 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; -// Apresentação da ultima parte da historia do jogo - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 E assim sua busca se inicia, você pega sua BICICLETA, seu único 8'); - writeln('8 pokémon crescido, e pedala até o ginásio que abriga os campeões 8'); - writeln('8 da liga Quiz Go! , determinado a enfrentar o maior desafio de 8'); - writeln('8 sua vida! 8'); - writeln('8 8'); - writeln('8 EvvYXX 8'); - writeln('8 i7:i.:ui ...,.... 8'); - writeln('8 O: Xr k@r:.....jB 8'); - writeln('8 Lr M :i;L,7iL. 8'); - writeln('8 ,7 Br7vvLvLvv7i:iBi @7 8'); - writeln('8 5 YXivLLLLvLvvr:1S @JrX 8'); - writeln('8 :vLYY7Jv Bu: .....,. :@ 2jrUiq7 ,iiri: 8'); - writeln('8 PNquj;iu@ ME.rv B .B :X,;@OJuJL1kGX; 8'); - writeln('8 .@7L. . Z J2vBrrUU: 22 B BL.kj : 7:7PM 8'); - writeln('8 @.i,, 12 Y;.i7B,vvuS, .B Or O7vX.iLr . .7YZ 8'); - writeln('8 @:i rvPrSJ ,.@ 7uruu B :N :@.: 8LjBLi . ,:S 8'); - writeln('8 B 7 ..Gv :O :N: uv:B0 @ .:i:5jrii,O5 @:. ii 8'); - writeln('8 @Y: ::ru77 J:@ .B, UMrvJLLrLivi5Xv77S .:iU 8'); - writeln('8 MLLi . r i@J r7,JSiri:,.B1ii J r iJ8 8'); - writeln('8 Oqv: 7 iU2Bv . MXi. ,: .JrNB 8'); - writeln('8 7uuj7LuUvi .LuuY7ivYUL: 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 1º GINÁSIO 8'); - writeln('8 PORTUGUÊS 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 ..,:iirr77vvLvLv7rrii::.. 8'); - writeln('8 .:7uUSqk55JJvv7ririi:i:ri;r7vYY11Skk1uLr:. 8'); - writeln('8 :vUZqFvv:, .:r7UFGPui. 8'); - writeln('8 vEMS7: .iuGOSi 8'); - writeln('8 ,MMu, "Aqui começa sua jornada, meu caro estudante rPB5 8'); - writeln('8 Z@: E para iniciá-la, você tem que derrotar o grande 0B, 8'); - writeln('8 G@ Professor Pasquale, que vos fala. Você está pronto ,B 8'); - writeln('8 @: para as minhas perguntas de PORTUGUÊS? @, 8'); - writeln('8 Y@ UB 8'); - writeln('8 7@U :@@ 8'); - writeln('8 uMGr. :2MZi 8'); - writeln('8 ,UqOF7:. .;LE8Xr 8'); - writeln('8 :r2PNku7;:,. @NFJi. 8'); - writeln('8 .,i7JuXSFS12uYJYLvLvLvLJjj1J;, J@ 8'); - writeln('8 ..,:::i:i:i:::,,;LXPq5ur: Bv 8'); - writeln('8 ,iY1SE@ 8'); - writeln('8 1SE@ 8'); - writeln('8 8'); - writeln('8 PROFESSOR PASQUALE 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - // Limpatela - // Uso do repita até contador de vida = 0 - clrscr; - repeat - // Atribuição de valores - level := 1; - contvida := 0; - // Pergunta PORT 1 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: 0'); - writeln(''); - writeln('OPONENTE = PROFESSOR PASCAL - Portugon HP = 100 '); - // CAMPO DE PERGUNTAS - writeln('I) Qual das alternativas é uma oração do tipo Adversidade?'); - writeln(''); - writeln('1)A aula do professor é muito interessante, e divertida '); - writeln('2)Não fui à aula hoje porque estava doente. '); - writeln('3)Eu gosto de bolo de chocolate, ela, de baunilha '); - writeln('4)O time jogou bem, mas perdeu o jogo '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - - //Mudança de Cores - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '4' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '3') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -10 DE HP'); - writeln(''); - life := life - 10; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - - - // Mudança de Cores - textcolor(white); - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - - // Pergunta PORT 2 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: 0'); - writeln(''); - writeln('OPONENTE = PROFESSOR PASCAL - Portugon HP = 60 '); - // CAMPO DE PERGUNTAS - writeln('II) Qual a figura de linguagem utilizada na frase "Está chovendo canivetes!"'); - writeln(''); - writeln('1)Pleonasmo '); - writeln('2)Elipse '); - writeln('3)Metáfora '); - writeln('4)Metonímia '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '3' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -10 DE HP'); - writeln(''); - life := life - 10; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - textcolor(white); - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - - // Pergunta PORT 3 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: 0'); - writeln(''); - writeln('OPONENTE = PROFESSOR PASCAL - Portugon HP = 20 '); - // CAMPO DE PERGUNTAS - writeln('III)"Me disseram que os filmes do Senhor dos Anéis são muito bons." Qual o tipo de sujeito?'); - writeln(''); - writeln('1)Oculto '); - writeln('2)Simples '); - writeln('3)Um nerd '); - writeln('4)Indeterminado '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '4' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '3') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -10 DE HP'); - writeln(''); - life := life - 10; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - textcolor(white); - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - cont := 0; - - until contvida = 0; - - // USO DO SE CASO VIDA MAIOR QUE 0 - if vida > 0 then - begin - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 PORTUGON 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 Ao som de pequenas engrenagens girando e bips, você nota que se aproxima 8'); - writeln('8 um pequeno robô não chegando nem a bater em seu joelho: Portugon. 8'); - writeln('8 Um robôzinho de duas pernas rotatórias que se assemelha a uma ave, 8'); - writeln('8 mas por ser feito de metal da cabeça aos pés, é incapaz de voar. 8'); - writeln('8 A criaturinha robótica tira um momento de sua cuidadosa leitura, 8'); - writeln('8 para se apróximar de você e começar o combate. 8'); - writeln('8 8'); - write('8 '); - textcolor(lightgreen); - write('##SEU POKÉMON TEM A CAPACIDADE DE DAR DICAS EM 1 PERGUNTA NO PRÓX. GINÁSIO##'); - textcolor(white); - writeln(' 8'); - writeln('8 :uZ2@ZY , 8'); - writeln('8 LU2.: 20@ .B@ 8'); - writeln('8 X1757ivB@B iYB7 8'); - writeln('8 .vv8@B@@@Br,727B@ 8'); - writeln('8 Jr2OSB@B@B:iLL7L@7 8'); - writeln('8 :2: ..rvi:vjvB 8'); - writeln('8 r,XMU7:7q7O57uY:r 8'); - writeln('8 i8X@@B@B@B@B,..rMO@ 8'); - writeln('8 r1. :PBr,,v@BM: 8'); - writeln('8 :F2Z@F: 8'); - writeln('8 8'); - writeln('8 *** LEMBRE-SE: PARA USÁ-LO BASTA INSERIR "P" NO CAMPO DE RESPOSTA *** 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 2º GINÁSIO 8'); - writeln('8 CIÊNCIAS 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 ..,:iirr77vvLvLv7rrii::.. 8'); - writeln('8 .:7uUSqk55JJvv7ririi:i:ri;r7vYY11Skk1uLr:. 8'); - writeln('8 :vUZqFvv:, .:r7UFGPui. 8'); - writeln('8 vEMS7: .iuGOSi 8'); - writeln('8 ,MMu, "Olá e bem-vindo ao ginásio de CIÊNCIAS, rPB5 8'); - writeln('8 Z@: eu serei seu adversário, Professor Valtinho Branco. 0B, 8'); - writeln('8 G@ espero que ainda se lembre das suas aulas de ,B 8'); - writeln('8 @: Biologia, Química e Física. VAI, BIOSSAURO!" @, 8'); - writeln('8 Y@ UB 8'); - writeln('8 7@U :@@ 8'); - writeln('8 uMGr. :2MZi 8'); - writeln('8 ,UqOF7:. .;LE8Xr 8'); - writeln('8 :r2PNku7;:,. @NFJi. 8'); - writeln('8 .,i7JuXSFS12uYJYLvLvLvLJjj1J;, J@ 8'); - writeln('8 ..,:::i:i:i:::,,;LXPq5ur: Bv 8'); - writeln('8 ,iY1SE@ 8'); - writeln('8 1SE@ 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PROFESSOR VALTINHO BRANCO 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - end; - - clrscr; - repeat - contvida := 0; - level := 2; - // Pergunta CIENCIAS 1 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Portugon "P"'); - writeln(''); - writeln('OPONENTE = Valtinho Branco (Walter White) - Biossauro HP = 100 '); - // CAMPO DE PERGUNTAS - writeln('I) Em quantos Graus CelsiuS a água entra em ponto de fusão?'); - writeln(''); - writeln('1)100 '); - writeln('2)0 '); - writeln('3)-1 '); - writeln('4)200 '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - - clrscr; - textcolor(lightgreen); - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -15 DE HP'); - writeln(''); - life := life - 15; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - cont := 1; - pok := 1; - writeln('VOCÊ USOU O POKÉMON PORTUGON!'); - writeln('DICA: ACHO QUE A RESPOSTA SERÁ A SUA NOTA SE VOCÊ NÃO ACERTAR'); - writeln(''); - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU SUA DICA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - - // Pergunta CIENCIAS 2 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Portugon "P"'); - writeln(''); - writeln('OPONENTE = Valtinho Branco (Walter White) - Biossauro HP = 60 '); - // CAMPO DE PERGUNTAS - writeln('II) Quantas Ligações o Carbono pode fazer?'); - writeln(''); - writeln('1)1 '); - writeln('2)2 '); - writeln('3)3 '); - writeln('4)4 '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - clrscr; - textcolor(lightgreen); - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '4' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '3') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -15 DE HP'); - writeln(''); - life := life - 15; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - cont := 1; - pok := 1; - writeln('VOCÊ USOU O POKÉMON PORTUGON!'); - writeln('DICA: ELE NÃO ENTRARIA PRO PÓDIO..'); - writeln(''); - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU SUA DICA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - textcolor(white); - - // Pergunta CIENCIAS 3 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Portugon "P"'); - writeln(''); - writeln('OPONENTE = Valtinho Branco (Walter White) - Biossauro HP = 20 '); - // CAMPO DE PERGUNTAS - writeln('III) Qual desses elementos não existe na tabela periódica?'); - writeln(''); - writeln('1) Tungstênio '); - writeln('2) Germânico '); - writeln('3) Iodo '); - writeln('4) Hispânico '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - clrscr; - textcolor(lightgreen); - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '4' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '3') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -15 DE HP'); - writeln(''); - life := life - 15; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - cont := 1; - pok := 1; - writeln('VOCÊ USOU O POKÉMON PORTUGON!'); - writeln('DICA: ÚSTED SABE LA RESPUESTA, NIEGRO.. '); - writeln(''); - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU SUA DICA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - cont := 0; - textcolor(white); - until contvida = 0; - - // USO DO SE CASO VIDA MAIOR QUE 0 - if vida > 0 then - begin - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 BIOSSAURO 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 Você se espanta por um momento quando nota uma repentina agitação 8'); - writeln('8 no meio das diversas folhagens que carpetam o ginásio,é quando uma 8'); - writeln('8 das plantas sai do meio das folhagens e dá um rosnado brincalhão 8'); - writeln('8 Você percebe que não se trata de uma planta,mas sim do Pokémon BIOSSAURO. 8'); - writeln('8 Um pequeno dinossauro verde, não chegando meio metro de altura, 8'); - writeln('8 com um bulbo de planta em suas costas, 8'); - writeln('8 vestido com um pequeno jaleco branco de cientista, pronto pra atacar 8'); - writeln('8 8'); - write('8 '); - textcolor(lightgreen); - write(' ## SEU POKÉMON TEM A CAPACIDADE DE PULAR 1 PERGUNTA NO PRÓX. GINÁSIO ## '); - textcolor(white); - writeln(' 8'); - writeln('8 .vZGu, 8'); - writeln('8 iJX0NjL7LL2j@U 8'); - writeln('8 iLr 7uNuvr7;77YLYBP 8'); - writeln('8 ,7rvuEB@v;i,:iZUuuYvLBB7 8'); - writeln('8 ri77@BML;::ii:2O277rU8@B: 8'); - writeln('8 :M7Nr;F,::rZ@i::FqSY1EEG@B 8'); - writeln('8 rMJ::11ii:r@:@:i:vM@8Z0OM@ 8'); - writeln('8 rJNr,i:::r B5B7::L@B@OBO@B 8'); - writeln('8 L0Sv:iii;;r,Y2i:;i,7MOru@E 8'); - writeln('8 .5@O11PEM@0Lr:;ii:i,. :7 8'); - writeln('8 .7rYr7rv7rYrii:78Jv0ir, 8'); - writeln('8 Y@JPX00NGi:X5:kOr@B2ir 8'); - writeln('8 EBJ0@;.BPL@iiq@MYuUrGi 8'); - writeln('8 rLO@L :UMF;EL rBZ1@G 8'); - writeln('8 . .:iU: :i7i 8'); - writeln('8 8'); - writeln('8 *** LEMBRE-SE: PARA USÁ-LO BASTA INSERIR "P" NO CAMPO DE RESPOSTA *** 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 3º GINÁSIO 8'); - writeln('8 HISTÓRIA 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 ..,:iirr77vvLvLv7rrii::.. 8'); - writeln('8 .:7uUSqk55JJvv7ririi:i:ri;r7vYY11Skk1uLr:. 8'); - writeln('8 :vUZqFvv:, .:r7UFGPui. 8'); - writeln('8 vEMS7: .iuGOSi 8'); - writeln('8 ,MMu, "Ahhh, sim, sim. Os professores me informaram rPB5 8'); - writeln('8 Z@: da sua chegada. Eu sou o professor Dumb Bulldog, 0B, 8'); - writeln('8 G@ e irei avaliar se você está pronto pra continuar ,B 8'); - writeln('8 @: sua jornada com minhas perguntas de HISTÓRIA. @, 8'); - writeln('8 Y@ VAI, AERODÁTICO!" UB 8'); - writeln('8 7@U :@@ 8'); - writeln('8 uMGr. :2MZi 8'); - writeln('8 ,UqOF7:. .;LE8Xr 8'); - writeln('8 :r2PNku7;:,. @NFJi. 8'); - writeln('8 .,i7JuXSFS12uYJYLvLvLvLJjj1J;, J@ 8'); - writeln('8 ..,:::i:i:i:::,,;LXPq5ur: Bv 8'); - writeln('8 ,iY1SE@ 8'); - writeln('8 1SE@ 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PROFESSOR DUMB BULL DOG 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - end; - - clrscr; - repeat - contvida := 0; - level := 3; - // Pergunta HISTÓRIA 1 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: BIOSSAURO '); - writeln(''); - writeln('OPONENTE = Dumb bulldog - Aerodático HP = 100 '); - // CAMPO DE PERGUNTAS - writeln('I)Na Idade Antiga existia uma escrita feita pelos egípcios. Qual é o nome desta escrita?'); - writeln(''); - writeln('1)Cuneiforme '); - writeln('2)Hieróglifo '); - writeln('3)Acadiano '); - writeln('4)Egípcia '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -20 DE HP'); - writeln(''); - life := life - 20; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON BIOSSAURO!'); - writeln('VOCÊ PULOU'); - writeln(''); - verif := 'V'; - cont := cont + 1; - pok := 1; - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ PULOU UMA PERGUNTA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - - // Pergunta HISTÓRIA 2 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: BIOSSAURO '); - writeln(''); - writeln('OPONENTE = Dumb bulldog HP = 70 '); - // CAMPO DE PERGUNTAS - writeln('II) Qual era o estilo político da Inglaterra anterior a Revolução Inglesa?'); - writeln(''); - writeln('1)Monarquia Absolutista. '); - writeln('2)Democracia '); - writeln('3)Monarquia Parlamentarista '); - writeln('4)Ditadura '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - - clrscr; - textcolor(lightgreen); - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '1' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '2') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -20 DE HP'); - life := life - 20; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON BIOSSAURO!'); - writeln('VOCÊ PULOU'); - writeln(''); - verif := 'V'; - cont := cont + 1; - pok := 1; - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ PULOU UMA PERGUNTA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - textcolor(white); - // Pergunta HISTÓRIA 3 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: BIOSSAURO '); - writeln(''); - writeln('OPONENTE = Dumb bulldog HP = 40 '); - // CAMPO DE PERGUNTAS - writeln('III) Que período durou a Ditadura Militar no Brasil?'); - writeln(''); - writeln('1)1964-1985 '); - writeln('2)1914-1919 '); - writeln('3)2000-2016 '); - writeln('4)1939-1945 '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '1' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '2') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -20 DE HP'); - life := life - 20; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON BIOSSAURO!'); - writeln('VOCÊ PULOU'); - writeln(''); - verif := 'V'; - cont := cont + 1; - pok := 1; - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ PULOU UMA PERGUNTA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - // Pergunta HISTÓRIA 4 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: BIOSSAURO '); - writeln(''); - writeln('OPONENTE = Dumb bulldog HP = 10 '); - // CAMPO DE PERGUNTAS - writeln('IV) Qual era o nome do Rei dos Deuses para os egípcios?'); - writeln(''); - writeln('1)Osíris '); - writeln('2)Tot '); - writeln('3)Hórus '); - writeln('4)Rá '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '4' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '3') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -20 DE HP'); - life := life - 20; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON BIOSSAURO!'); - writeln('VOCÊ PULOU'); - writeln(''); - verif := 'V'; - cont := cont + 1; - pok := 1; - end - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ PULOU UMA PERGUNTA! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - cont := 0; - until contvida = 0; - - // USO DO SE CASO VIDA MAIOR QUE 0 - if vida > 0 then - begin - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 AERODÁTICO 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 Você ouve um rugido agudo ecoando metros acima de sua cabeça, 8'); - writeln('8 olha pra cima e vê a forma gigante do dragão AERODÁTICO, 8'); - writeln('8 voando por cima das várias estantes de livros de história 8'); - writeln('8 que constituem o magnífico "ginásio-biblioteca", 8'); - writeln('8 sua forma de dragão cinzento de pele dura fazendo eclipses 8'); - writeln('8 em cada raio de luz por onde voa até finalmente pousar 8'); - writeln('8 sua forma intimidadora em sua frente, suas asas terminando de bater, 8'); - writeln('8 fazendo a poeira voar por entre seus pés... 8'); - writeln('8 Finalmente optando por disfarçar o medo... Você dá um passo a frente. 8'); - writeln('8 8'); - write('8 '); - textcolor(lightgreen); - write(' ## SEU POKÉMON TEM A CAPACIDADE DE ANULAR 2 RESPOSTAS NO PRÓX. GINÁSIO ## '); - textcolor(white); - writeln(' 8'); - writeln('8 7 8'); - writeln('8 ., : ii:.,.. 8'); - writeln('8 iqBi ;OBrujrr: ,5@BBM@B@MP7. 8'); - writeln('8 :B@MBB: B@1iL: v@uLjPFi 8'); - writeln('8 ii: .:kB7 rB@75 :@jLjqr 8'); - writeln('8 7@SFrvq@, :MBqXZi 8'); - writeln('8 @Mijuiu7Y1 PB@GFuuX 8'); - writeln('8 uUJuXBirr7L@Mi :L5J. 8'); - writeln('8 ii;r:rS. .r7i:j 8'); - writeln('8 .7;;rSE;,,iUXU: 8'); - writeln('8 ,uBXE@XL@BNS7. 8'); - writeln('8 OB .L@: 8'); - writeln('8 8'); - writeln('8 *** LEMBRE-SE: PARA USÁ-LO BASTA INSERIR "P" NO CAMPO DE RESPOSTA *** 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 4º GINÁSIO 8'); - writeln('8 MATEMÁTICA 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 ..,:iirr77vvLvLv7rrii::.. 8'); - writeln('8 .:7uUSqk55JJvv7ririi:i:ri;r7vYY11Skk1uLr:. 8'); - writeln('8 :vUZqFvv:, .:r7UFGPui. 8'); - writeln('8 vEMS7: .iuGOSi 8'); - writeln('8 ,MMu, "Você deve ser bem "mizerávi" pra chegar até aqui. PB5 8'); - writeln('8 Z@: Mas lamento te informar que aqui termina sua batalha. 0B, 8'); - writeln('8 G@ Duvida? Então testemunhe meu teste de matemática! ,B 8'); - writeln('8 @: VAI, PI DE OITO!" @, 8'); - writeln('8 Y@ UB 8'); - writeln('8 7@U :@@ 8'); - writeln('8 uMGr. :2MZi 8'); - writeln('8 ,UqOF7:. .;LE8Xr 8'); - writeln('8 :r2PNku7;:,. @NFJi. 8'); - writeln('8 .,i7JuXSFS12uYJYLvLvLvLJjj1J;, J@ 8'); - writeln('8 ..,:::i:i:i:::,,;LXPq5ur: Bv 8'); - writeln('8 ,iY1SE@ 8'); - writeln('8 1SE@ 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PROFESSOR PELÉZINHO 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - end; - - - clrscr; - repeat - contvida := 0; - level := 4; - // Pergunta MATEMATICA 1 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Aerodático '); - writeln(''); - writeln('OPONENTE = Professor Pelézinho - Pi de Oito HP = 100 '); - // CAMPO DE PERGUNTAS - writeln('I) Qual ângulo em radianos representa 360º? '); - writeln(''); - writeln('1)PI'); - writeln('2)2PI '); - writeln('3)3PI/2 '); - writeln('4)PI/2 '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -25 DE HP'); - life := life - 25; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON AERODÁTICO!'); - writeln('ALTERNATIVAS 3 E 4 ESTÃO ERRADAS '); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU O SEU POKEMON! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - textcolor(white); - - // Pergunta MATEMATICA 2 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Aerodático '); - writeln(''); - writeln('OPONENTE = Professor Pelézinho HP = 70 '); - // CAMPO DE PERGUNTAS - writeln('II) Qual a formula de Delta? '); - writeln(''); - writeln('1)Delta = -b²*4*a*c ?'); - writeln('2)Delta = b²-4*a-c ?'); - writeln('3)Delta= b²-4*a*c '); - writeln('4)Delta= b²+a²+c² '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '3' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -25 DE HP'); - life := life - 25; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON AERODÁTICO!'); - writeln('ALTERNATIVAS 2 E 4 ESTÃO ERRADAS '); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU O SEU POKEMON! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - textcolor(white); -// Pergunta MATEMATICA 3 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Aerodático '); - writeln(''); - writeln('OPONENTE = Professor Pelézinho HP = 40 '); - // CAMPO DE PERGUNTAS - writeln('III) Qual a formula do perímetro de uma circunferência? '); - writeln(''); - writeln('1)Pi*r² '); - writeln('2)2pi * r² '); - writeln('3)2pi * r '); - writeln('4)pi*r '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '3' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '2') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -25 DE HP'); - life := life - 25; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON AERODÁTICO!'); - writeln('ALTERNATIVAS 1 E 4 ESTÃO ERRADAS '); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU O SEU POKEMON! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - textcolor(white); -// Pergunta MATEMATICA 4 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: Aerodático '); - writeln(''); - writeln('OPONENTE = Professor Pelézinho HP = 10 '); - // CAMPO DE PERGUNTAS - writeln('IV) Qual o resultado da seguinte equação: x² + 2x + 4 = 0 ? '); - writeln(''); - writeln('1) (-2 + 2i)/2 e (2 + 2i)/2 '); - writeln('2) 2i '); - writeln('3) (-1 + 2i)/2 e (2 + 2i)/2 '); - writeln('4) 4i '); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '1' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '2') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -25 DE HP'); - life := life - 25; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - writeln('VOCÊ USOU O POKÉMON AERODÁTICO!'); - writeln('ALTERNATIVAS 2 E 4 ESTÃO ERRADAS '); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ JÁ USOU O SEU POKEMON! :)'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - //ATRIBUIÇÃO DE DADOS - verif := 'F'; - cont := 0; - textcolor(white); - until contvida = 0; - - // USO DO SE CASO VIDA MAIOR QUE 0 - if vida > 0 then - begin - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PI DE OITO 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 No meio do ginásio de matemática, onde existe uma gigantesca árvore seca 8'); - writeln('8 completamente coberta por somas, equações e logarítmos variados, 8'); - writeln('8 você vê, apoiado no galho mais alto, o PI DE OITO! 8'); - writeln('8 Uma belíssima ave, de pelo menos dois metros de altura e penas 8'); - writeln('8 nas cores branca, magenta, e marrom.Ela vira os olhos afiados para você, 8'); - writeln('8 como um falcão que acaba de detectar sua presa, 8'); - writeln('8 e então levanta as asas e dá um rasante em sua direção. 8'); - writeln('8 Mas enquanto o vôo da ave é rapido e turbulento, 8'); - writeln('8 o pouso é delicado e calculado. Você se prepara para um árduo desafio. 8'); - writeln('8 8'); - write('8 '); - textcolor(lightgreen); - write(' ## SEU POKÉMON TEM A CAPACIDADE DE LHE DAR +50 NO PRÓX. GINÁSIO ## '); - textcolor(white); - writeln(' 8'); - writeln('8 :X 8'); - writeln('8 ,: 8'); - writeln('8 .Y :EJjv. 8'); - writeln('8 .uL 7kMNX7 B7 rJ. 8'); - writeln('8 ri5B@B@B@B@B7 .iS. 8'); - writeln('8 ir5@BSF@O@BL .rLv. 8'); - writeln('8 :Yik2 k8B: :vvvi 8'); - writeln('8 :LviYki ivj: 8'); - writeln('8 ,. ,rF7. 8'); - writeln('8 r. i: .kPB 8'); - writeln('8 :7@B i77ruZuqSY7. 8'); - writeln('8 ::7OG,, 7B0@BEBZ 8'); - writeln('8 7 BSF@XSL 8'); - writeln('8 jP.uE: 8'); - writeln('8 8'); - writeln('8 *** LEMBRE-SE: PARA USÁ-LO BASTA INSERIR "P" NO CAMPO DE RESPOSTA *** 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - clrscr; - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - writeln('8 ÚLTIMO GINÁSIO 8'); - writeln('8 INFORMÁTICA 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 ..,:iirr77vvLvLv7rrii::.. 8'); - writeln('8 .:7uUSqk55JJvv7ririi:i:ri;r7vYY11Skk1uLr:. 8'); - writeln('8 :vUZqFvv:, .:r7UFGPui. 8'); - writeln('8 vEMS7: .iuGOSi 8'); - writeln('8 ,MMu, "Ora, ora, ora. O que temos aqui? rPB5 8'); - writeln('8 Z@: Um desafiante que se acha capaz de se tornar 0B, 8'); - writeln('8 G@ o novo campeão do Quiz GO!? Eu te alerto, jovem. ,B 8'); - writeln('8 @: Todos os desafios que você enfrentou, @, 8'); - writeln('8 Y@ Prepare-se para o confronto de sua vida! UB 8'); - writeln('8 7@U VAI, MIL !" :@@ 8'); - writeln('8 uMGr. :2MZi 8'); - writeln('8 ,UqOF7:. .;LE8Xr 8'); - writeln('8 :r2PNku7;:,. @NFJi. 8'); - writeln('8 .,i7JuXSFS12uYJYLvLvLvLJjj1J;, J@ 8'); - writeln('8 ..,:::i:i:i:::,,;LXPq5ur: Bv 8'); - writeln('8 ,iY1SE@ 8'); - writeln('8 1SE@ 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 BILL JOBS 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 8'); - writeln('8 PRESSIONE QUALQUER TECLA.. 8'); - writeln('88888888888888888888888888888888888888888888888888888888888888888888888888888888'); - readkey; - end; - - clrscr; - repeat - level := 5; - contvida := 0; - // Pergunta INFORMATICA 1 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: PI DE OITO '); - writeln(''); - writeln('OPONENTE = Bill Jobs - Mil HP = 100 '); - // CAMPO DE PERGUNTAS - writeln('I) Quem foi o criador da primeira calculadora analítica? '); - writeln(''); - writeln('1)Blaise Pascal'); - writeln('2)Charles Babbage '); - writeln('3)Steve Jobs '); - writeln('4)Johnny Cálculo'); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -30 DE HP'); - life := life - 30; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - life := life + 50; - writeln('VOCÊ USOU O POKÉMON PI DE OITO!'); - writeln('VOCÊ USOU UM HP DE +50'); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ NÃO PODE USAR MAIS NENHUM POKÉMON ,SORRY :) !'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - // ATRIBUIÇÃO DE VALORES - verif := 'F'; - - // Pergunta INFORMATICA 2 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: PI DE OITO '); - writeln(''); - writeln('OPONENTE = Bill Jobs - Mil HP = 70 '); - // CAMPO DE PERGUNTAS - writeln('II) Qual o nome do Primeiro vírus de Computador '); - writeln(''); - writeln('1)The Creeper'); - writeln('2)I Love You'); - writeln('3)Jubileu'); - writeln('4)The Zombie'); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '1' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '2') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -30 DE HP'); - life := life - 30; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - life := life + 50; - writeln('VOCÊ USOU O POKÉMON PI DE OITO!'); - writeln('VOCÊ USOU UM HP DE +50'); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ NÃO PODE USAR MAIS NENHUM POKÉMON ,SORRY :) !'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - // ATRIBUIÇÃO DE VALORES - verif := 'F'; - - // Pergunta INFORMATICA 3 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: PI DE OITO '); - writeln(''); - writeln('OPONENTE = Bill Jobs - Mil HP = 40 '); - // CAMPO DE PERGUNTAS - writeln('III) Qual dos periféricos abaixo é um periférico de entrada de dados? '); - writeln(''); - writeln('1)Datashow.'); - writeln('2)Teclado.'); - writeln('3)Impressora.'); - writeln('4)Gabinete'); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100; - writeln('BILL JOBS USOU O MIL PARA GANHAR +50 DE HP'); - writeln(''); - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -30 DE HP'); - life := life - 30; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - life := life + 50; - writeln('VOCÊ USOU O POKÉMON PI DE OITO!'); - writeln('VOCÊ USOU UM HP DE +50'); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ NÃO PODE USAR MAIS NENHUM POKÉMON ,SORRY :) !'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - // ATRIBUIÇÃO DE VALORES - verif := 'F'; - - // Pergunta INFORMATICA 4 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: PI DE OITO '); - writeln(''); - writeln('OPONENTE = Bill Jobs - Mil HP = 60 '); - // CAMPO DE PERGUNTAS - writeln('IV) O que é um Sistema de Informação?'); - writeln(''); - writeln('1)Sistema de informação é um conjunto de componentes(entrada de recursos de dados,processamento) que tem como objetivo'); - writeln('apresentar entrada de produto de informação úteis ao usuário final..'); - writeln(''); - writeln('2)Sistema de informação é um conjunto de componentes(entrada de recursos de dados,processamento) que tem como objetivo'); - writeln('apresentar saída de produto de informação úteis ao usuário final..'); - writeln(''); - writeln('3)Sistema de informação é um conjunto de componentes(entrada de recursos de dados,processamento) que tem como objetivo'); - writeln('apresentar o valor do produto de informação úteis ao usuário final..'); - writeln(''); - writeln('4)Sistema de informação é um conjunto de componentes(entrada de recursos de dados,processamento) que tem como objetivo'); - writeln('apresentar entrada de produto de informação úteis ao usuário primátio..'); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -30 DE HP'); - life := life - 30; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - life := life + 50; - writeln('VOCÊ USOU O POKÉMON PI DE OITO!'); - writeln('VOCÊ USOU UM HP DE +50'); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ NÃO PODE USAR MAIS NENHUM POKÉMON ,SORRY :) !'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - textcolor(white); - // ATRIBUIÇÃO DE VALORES - verif := 'F'; - - // Pergunta INFORMATICA 5 - // USO DO ENQUANTO PARA VERIFICADOR=FALSO E VIDA MAIOR QUE 0 - while (verif <> 'V') and (vida > 0) and (contvida = 0) do - Begin - textcolor(white); - //Cabeçalho - writeln('TREINADOR = ', nome, ' HP: ', life, ' VIDAS: ', vida, ' PONTUAÇÃO: ', pont); - writeln('POKEMONS DISPONIVEIS: PI DE OITO '); - writeln(''); - writeln('OPONENTE = Bill Jobs - Mil HP = 30 '); - // CAMPO DE PERGUNTAS - writeln('V) Qual a ordem correta das camadas? '); - writeln(''); - writeln('1)Sessão, apresentação, física, enlace, rede, transporte e aplicação.'); - writeln('2)Apresentação, aplicação, sessão, rede, transporte, enlace e física.'); - writeln('3)Aplicação, apresentação, sessão, transporte, rede, enlace e física.'); - writeln('4)Física, Enlace, Rede, Transporte, Sessão, Apresentação e Aplicação.'); - //ENTRADA DE DADOS - write('RESPOSTA = '); - read(resp); - textcolor(lightgreen); - clrscr; - // USO DO SE CASO RESPOSTA SEJA CORRETA - if resp = '2' then - begin - // Validade do Verificador - verif := 'V'; - // Contador de Pontuação - pont := pont + 100 - end - // SENÃO-SE PARA RESPOSTA ERRADA - else - if (resp = '1') or (resp = '3') or (resp = '4') then - begin - // MECâNICA PARA SUBTRAÇÃO DO HP - writeln('RESPOSTA ERRADA: -30 DE HP'); - life := life - 30; - // Contador de Pontuação - if pont > 0 then - begin - pont := pont - 50 - end; - end - // SENÃO-SE PARA USO DO SUPORTE POKÉMON - else - if (resp = 'P') or (resp = 'p') then - if (cont = 0) then - begin - life := life + 50; - writeln('VOCÊ USOU O POKÉMON PI DE OITO!'); - writeln('VOCÊ USOU UM HP DE +50'); - writeln(''); - cont := cont + 1; - pok := 1; - end - - // SENÃO-SE PARA POKÉMON JÁ USADO ANTERIORMENTE - else - if (resp = 'P') or (resp = 'p') then - if (cont = 1) then - begin - writeln('VOCÊ NÃO PODE USAR MAIS NENHUM POKÉMON ,SORRY :) !'); - writeln('') - end - // SENÃO PARA RESPOSTA INVÁLIDA - else - begin - writeln('RESPOSTA INVÁLIDA'); - writeln(''); - end; - - // MECÂNICA COM SE PARA SUBTRAÇÃO DE VIDA - if (life <= 0) then - begin - life := 100; - writeln('VOCÊ TERÁ QUE REINICIAR O GINÁSIO!'); - writeln('VOCÊ PERDEU UMA VIDA, TENHA CUIDADO...'); - writeln(''); - //Atribuição de Valores - verif := 'V'; - contvida := 1; - vida := vida - 1; - - // USO DO SE PARA SUBTRAÇÃO DE PONTUAÇÃO POR PERCA DE VIDA. - if pont >= 500 then - begin - pont := pont - 500 - end - // SENÃO CASO PONTUAÇÃO MENOR QUE 500 - else - begin - resto := pont; - pont := pont - resto; - end; - end; - end; - - - // ATRIBUIÇÃO DE VALORES - verif := 'F'; - cont := 0; - until contvida = 0; - textcolor(white); -end; - - // PROGRAMA PRINCIPAL -begin - // Chamada do Procedimento JOGO - JOGO; - // Uso do se caso não reste nenhuma vida. - if vida = 0 then - begin - clrscr; - writeln(' ____ _ __ __ _____ _____ _______ ____ __ '); - writeln(' / ___| / \ | \/ | ____| / _ \ \ / / ____| _ \ _ / / '); - writeln(' | | _ / _ \ | |\/| | _| | | | \ \ / /| _| | |_) | (_) | | '); - writeln(' | |_| |/ ___ \| | | | |___ | |_| |\ V / | |___| _ < _ | | '); - writeln(' \____/_/ \_\_| |_|_____| \___/ \_/ |_____|_| \_\ (_) | | '); - writeln(' \_\ '); - // Uso do caso para mensagem de acordo com o level em que o usuário perdeu - case level of - 1 : writeln('PROF PASQUALE = Não desista, você só está começando!'); - 2 : writeln('PROF VALTINHO BRANCO = NEstá na hora de revisar seus estudos.'); - 3 : writeln('PROF DUMB BULLDOG = Lamento, mas parece que você pulou algumas páginas do seu livro de história.'); - 4 : writeln('PROF PELÉZINHO = Aaaaah, eu sabia que você não estava pronto!'); - 5 : writeln('PROF BILL JOBS = Você não vai desistir agora, vai? Eu sinceramente ficaria decepcionado.'); - END; - // Opção de Reiniciar o Jogo - writeln(''); - writeln(' VC DESEJA REINICIAR O JOGO? S/N? '); - read(reiniciar); - // Se reiniciar for SIM, chama novamente o procedimento JOGO - if (reiniciar = 'S') or (reiniciar = 's') then - JOGO - // Senão, encerra o jogo - else - writeln('OBRIGADO POR JOGAR'); - - end - -// SENÃO PARA SE USUÁRIO CONSEGUIU FINALIZAR O JOGO - else - begin - clrscr; - gotoxy(0, 25); - writeln(''); - writeln(''); - writeln(''); - writeln('-----------------------------------------------------------------------'); - writeln(' __ _____ _ _ __ __ ___ _ _ _ '); - writeln(' \ \ / / _ \| | | | \ \ / / |_ _| | \ | | | | '); - writeln(' \ V / | | | | | | \ \ /\ / / | | | \| | | | '); - writeln(' | || |_| | |_| | \ V V / | | | |\ | |_| '); - writeln(' |_| \___/ \___/ \_/\_/ |___| |_| \_| (_) '); - writeln('-----------------------------------------------------------------------'); - writeln(' Bill Jobs : E-Eu não acredito! Você me derrotou!................. '); - writeln(' Bem... Só me resta dar-lhe os parabéns, campeão.'); - writeln(' Você finalizou o Quiz GO!, e como prêmio, eu lhe'); - writeln(' darei meu pokémon mais raro, Mil. '); - writeln(''); - writeln(' Graças a você, a população dos Archens será reconstruída!!'); - writeln(''); - writeln(' WE ARE THE CHAMPIONS, MY FRIEND.....'); - writeln(''); - writeln(' PARABÉNS,'); - writeln(''); - writeln(' VOCÊ ACABA DE CONQUISTAR A LIGA QUIZ GO!!!'); - writeln(' A JORNADA NÃO FOI FÁCIL, MAS VOCÊ FOI RECOMPENSADO!'); - writeln(''); - textcolor(lightgreen); - writeln(' SUA PONTUAÇÃO TOTAL FOI: ', pont); - writeln(''); - if vida > 0 then - begin - // Uso do se caso pontuação seja a máxima - if pont = 1900 then - begin - writeln(' VOCÊ CONQUISTOU A PONTUAÇÃO MÁXIMA!! \O\ /O/ '); - end; - end; - // Uso do se caso não necessite de Pokémons - if pok = 0 then - begin - writeln(' VOCÊ ZEROU O JOGO SEM NENHUMA AJUDA!!! '); - end; - // Bônus para Usuário caso não use nenhuma ajuda, e pontuação seja máxima. - if (pok = 0) and (pont = 1900) then - begin - writeln(' POR ESSA DOUBLE MITAGEM, VOCÊ GANHOU O PRÊMIO SECRETO: '); - writeln(''); - end; - textcolor(white); - writeln(' \O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/\O/ '); - writeln(' PRESSIONE ALGUMA TECLA PARA CONTINUAR '); - READKEY; - - // Bônus para Usuário caso não use nenhuma ajuda, e pontuação seja máxima. - if (pok = 0) and (pont = 1900) then - begin - clrscr; - writeln(' VOCÊ GANHOU O MARIO E O YOSHI!! '); - writeln(' PARA SABERMOS QUE VOCÊ GANHOU, LEVANTE E GRITE: "EU ACHEI O JUBILEU!" '); - writeln(' ######## '); - writeln(' ####CCCCCC//## '); - writeln(' ##CCCCtttt// ## '); - writeln(' ##CCttttttCCCC@@@@@@@@ '); - writeln(' ##CCttttttCCCC@@@@@@@@ '); - writeln(' ##CCttttttCC@@@@@@@@@@@@@@ '); - writeln(' ##CCttttttCC@@@@@@@@@@@@ '); - writeln(' ##CCttttttCC@@@@@@ @@@ '); - writeln(' ##CCtt^^^^@@@@@@(( @@ @@OOK@@ '); - writeln(' ##CCtttt((OO^^@@@@(( @@^^^^^^OOSSKK '); - writeln(' ##CCCC##((OO^^@@@@@@^^^^^^^^^^OOKK @@ '); - writeln(' ##CCCC##((OO^^@@@@@@^^^^^^^^^^OOKK @@ '); - writeln(' ##CC##@@((((^^^^@@^^^^@@((((((OO @@ @@@@@@ '); - writeln(' ##@@@@@@@@@@((^^^^@@@@@@@@@@@@ @@OOOOOO@@@@ '); - writeln(' @@@@@@@@@@((((((^^@@@@@@%%@@KK KKOOOOOO OO@@ '); - writeln(' @@@@@@@@@@@@((((^^OOOOOO@@SSKKKOOOOOOOOOO@@ @@ '); - writeln('################### ####GGGG######33##OO OOSSSSOOOOOOOOOOOOOOOOO@@ '); - writeln('################### ####GGGG######33##OO OOSSSSOOOOOOOOOOOOOOOOO@@ '); - writeln('##(((((((((((((((((####OOOO####CCtttt####OO OOSSOOOOOOOSSOOOOOOOOOO@@ '); - writeln('####((((((((((((###OOOO####33##CCttttttttttOO OOSSOOOOO @@SSOOOOOOOO@@ '); - writeln(' ####((((((####OOOOO##////33##CCCCttttttttttOOOO@@SSOOOOO @@SSOOOOOOOO@@ '); - writeln(' ########OOOOOO###33//////33##CCCCttttttCC##%%@@SSOOO @@@@KKSSOOOOSS@@ '); - writeln(' ############ GGGGGGGGGG//33####CCCCCC##@@@@@@SS @@KKSSSS@@ '); - writeln(' GG33////GG//////33######@@%%@@KKSS @@ @@@@@@ '); - writeln(' GG33////GG//////33######@@%%@@KKSS @@ @@@@@@ '); - writeln(' GGGG3333GG////////////GG^^@@@@SSSS @ @@@@@@ '); - writeln(' GGGGGG3333333333//////GG@@KKSS @@ '); - writeln(' GGGG333333333333////GG@@SSOO @@ '); - writeln(' @@SSGGGGGG33333333//GG@@SSOO @@ '); - writeln(' @@SS@@ GG33333333@@@@@@ @@ '); - writeln(' @@SS@@ GG33333333@@@@@@ @@ '); - writeln(' @@SS@@ @@GGGGGGOO//@@ @@ '); - writeln(' @@ SS@@@@@@OOOOOO@@@@OO @@ '); - writeln(' @@ SSSS@@@@@@@@@@ @@ '); - writeln(' @@ @@%%@@ @@ '); - writeln(' @@ @@%%%%%%@@ @@ '); - writeln(' @@ @@%%%%%%@@ @@ '); - writeln(' @@ @@@@%%%%%%@@ @@ '); - writeln(' @@@@ @@@@@@ @@ '); - writeln(' @@@@@@@@@@@@ '); - writeln(' @@GGGGGGGGGG@@ '); - writeln(' @@GGGGGGGGGG @@ '); - writeln(' @@GGGGGGGGGGGG@@ '); - writeln(' @@GGGGGGGGGGGG@@ '); - writeln(' @@@@@@@@@@@@@@@@ '); - writeln(' PRESSIONE ALGUMA TECLA PARA CONTINUAR... '); - readkey; - end; - - - // CRÉDITOS - // USO DO SE CASO VIDA FOR MAIOR QUE 0 - if vida > 0 then - clrscr; - writeln(' TURMA 52837 - 2016.2 '); - writeln(' PARTICIPANTES'); - WRITELN(''); - writeln(' CAROL SENA'); - writeln(' ( ) ( ) ) '); - writeln(' ) ( ) ( ( '); - writeln(' ( ) ( ) ) '); - writeln(' _____________ '); - writeln(' <_____________> ___ '); - writeln(' | |/ _ \ '); - writeln(' | | | | '); - writeln(' | |_| | '); - writeln(' ___| |\___/ '); - writeln(' / \___________/ \ '); - writeln(' \_____________________/ '); - writeln('PRESSIONE ALGUMA TECLA..'); - readkey; - - clrscr; - - textcolor(yellow); - writeln(' JANDERSON NASCIMENTO '); - writeln(' __________________________________ '); - writeln(' / | / \ | _ \ '); - writeln(' | (-----| |----`/ ^ \ | |_) | '); - writeln(' \ \ | | / /_\ \ | / '); - writeln(' .-----) | | | / _____ \ | |\ \-------. '); - writeln(' |________/ |__| /__/ \__\| _| `.________| '); - writeln(' ____ __ ____ ___ .______ ________.'); - writeln(' \ \ / \ / / / \ | _ \ / | '); - writeln(' \ \/ \/ / / ^ \ | |_) || (-----` '); - writeln(' \ / / /_\ \ | / \ \ '); - writeln(' \ /\ / / _____ \ | |\ \---) | '); - writeln(' \__/ \__/ /__/ \__\|__| `._______/ '); - writeln('PRESSIONE ALGUMA TECLA..'); - readkey; - - - clrscr; - - textcolor(lightgreen); - writeln(' KARINE MARIA'); - writeln(' ( '); - writeln(' \ '); - writeln(' ) '); - writeln(' ##-------------> ( * )'); - writeln(' ) '); - writeln(' / '); - writeln(' ( '); - writeln('PRESSIONE ALGUMA TECLA..'); - readkey; - - clrscr; - - textcolor(yellow); - writeln(' KEVIN ALMEIDA '); - writeln(' _==/ i i \==_ '); - writeln(' /XX/ |\___/| \XX\ '); - writeln(' /XXXX\ |XXXXX| /XXXX\'); - writeln(' |XXXXXX\_ _XXXXXXX_ _/XXXXXX|'); - writeln(' XXXXXXXXXXXxxxxxxxXXXXXXXXXXXxxxxxxxXXXXXXXXXXX '); - writeln('|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX| '); - writeln('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX '); - writeln('|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|'); - writeln(' XXXXXX/^^^^"\XXXXXXXXXXXXXXXXXXXXX/^^^^^\XXXXXX '); - writeln(' |XXX| \XXX/^^\XXXXX/^^\XXX/ |XXX|'); - writeln(' \XX\ \X/ \XXX/ \X/ /XX/ '); - writeln(' "\ " \X/ " /" '); - writeln('PRESSIONE ALGUMA TECLA..'); - readkey; - - clrscr; - - textcolor(white); - writeln('... E NOSSO PRINCIPAL PARTICIPANTE...'); - textcolor(lightgreen); - writeln(' VOCÊ ', nome, ' !!! '); - textcolor(white); - writeln(' ___________ ____ '); - writeln(' ______/ \__// \__/____\ '); - writeln(' _/ \_/ : //____\\ '); - writeln(' /| : : .. / \ '); - writeln(' | | :: :: \ / '); - writeln(' | | :| || \ \______/ '); - writeln(' | | || || |\ / | '); - writeln(' \| || || | / | \ '); - writeln(' | || || | / /_\ \ '); - writeln(' | ___ || ___ || | / / \ '); - writeln(' \_-_/ \_-_/ | ____ |/__/ \ '); - writeln(' _\_--_/ \ / '); - writeln(' /____ / '); - writeln(' / \ / '); - writeln(' \______\_________/ '); - writeln('PRESSIONE ALGUMA TECLA..'); - readkey; - - clrscr; - -// Finalização - - textcolor(lightgreen); - writeln(' PRESSIONE ALGUMA TECLA PARA FECHAR '); - writeln(' OBRIGADO POR JOGAR :D!!! ATÉ O PRÓXIMO SEMESTRE!! '); - writeln(' '); - writeln(' ` .i* '); - writeln(' `*x+i#xWWW. '); - writeln(' .;;inWWWWWWWWx` '); - writeln(' `+MWWWWWWWWWWWn. '); - writeln(' ,xWWWWWWWWWWWW#` '); - writeln(' `*MWWWWWWWWWWWW* '); - writeln(' `nWWWWWWWWWWWWM; '); - writeln(' .nWWWWWWWWWWWWM: '); - writeln(' .+MWWWWWWWWWWWWWW: '); - writeln(' ;MWWWWWWWWWWWWWWW* '); - writeln(' ,:`:#WWWWWWWWWWWWW+ '); - writeln(' ` ,MWWWWWWWWWWWW#iiii;, '); - writeln(' ,i##*, iWWWWWWWWWWWWWWWWWWWz '); - writeln(' ,*zz####i` `MWWWWWWWWWWWWWWWWWWM '); - writeln(' .*zz#######; nWWWWWWWWWWWWWWWWWW+ '); - writeln(' .i#z#########* `MWMMWWWWWWWWWWWWMx#` '); - writeln(' :#z##########+* ;z, `.;+##+i;::,.` '); - writeln(' `*zz##########++i`; '); - writeln(' `:#z############++. '); - writeln(' ,+##############+*. '); - writeln(' ``` .*###############+i` '); - writeln(' :i++*;:,,:`.. `;################+: '); - writeln(' :Mi:::::::;;** `*################+, '); - writeln(' ,n;,,,,,,:::::i. .+################+, '); - writeln(' `#;;:,:::ii:::::i` `,` `..`` ``,+#################; '); - writeln(' +zi;;;;:;i*;;;i;:` :n@@@x+;++i;;i+####################*` '); - writeln(' `Mx*izz:,;;;;;iWn*,..,.` `;#x@@@@n*;:xWWx+;;*#################+*` '); - writeln(' *Wn+*;+i::;+;+n@MzMWWWWMznW@@@@@xi;i##z@WWWz;;+########+##++++#+. '); - writeln(' :@z#+;;;iz+;###W@WM@@@@@@WWWWWxz*;*z#i:;z@WWW#;;#####+++++++++#+, '); - writeln(' .W@nz#i;;+**;iMz@@W@@@@@@@@@W+:;i#z+;:;+zx@@@WW*;i###+++++++++##, '); - writeln(' z@@xn#+;**ii+++M@@WW@@@@@@@Wi:+Mzi::*nx#*i#@@WWWi;+++++++++++#+. '); - writeln(' .@@@xx#+nM++**ii#W@WMW@@@@@Mi:zxi;izxzi;;;i#W@@WWz;*++++++++++*` '); - writeln(' *@@@xn++Mnnxnn*#nWWW#W@@@@x;;nM;;zM#;:;*nMWWW@@WWM;*#++++++++*` '); - writeln(' x@@@Mxz+Mn+zz+#ix@WM#W@Mx+:;Mx;;nn;:;#MWWW@WW@@WWW;*#++++###*` '); - writeln(' .W@@@MMz#znnz##nnM@W+x+::;:+M+:ix+:;#WW@@@WWWW@@WWW;+++**++i, '); - writeln(' ;@@@@WxnMn#xn#iW@@@x*x+;#n+*::+zi:+MWW@W@@WWWW@@WWM:+i,` '); - writeln(' +@@@@WzMz++xz+;+@@W#+xz#*:;*#z*;ixWW@W@###@WWW@@WWz:. '); - writeln(' `z@@@@@xWn#nnzi;*@@xzzx+:;inni;;#MWWWW@@###@WWW@@WMi.,nxzixxn#: ;nnn; ,nnziznzz*` '); - writeln(' .n@@@@@WWxMnn+*;*@@xnxMxMz+;:;#MWW@@WW@####@WWW@@Mi. ,W#@######z` x###x :#MM###@@#W, '); - writeln(' :z@@@@@WxnMWM#*;*@W+nMxz;:;i#MW@W@WWWW@####@WWW@W*, :W@@+WW####; .#####. :##W#@@@WW@n '); - writeln(' ;z@@@@@WxnzWMMx#iWM+xMx+*#MWW@WWWWWWWWW@##@WWW@@+, :x@@` .M##n *##@##* :##@```.+Mx@` '); - writeln(' izW@@@@WWMznxxzz*#z+xx#z##nWWWWWWWWWWWWW@@@WWW@#. :W#@` *##W x#####M :##@` ,@Wn '); - writeln(' `;nxzx@@@@@Wn#zxnxxxn++xz+###xWWWWWWWWW@@@@@@WWW@#` :@#@` i##W ,##@.@##, :##@,:::nMW; '); - writeln(' ,+W@@WzzM@@@@@WzzMMMnMz++n++###xWWWWWWWW@@@@@@@@WWW` :##@` i##W +##x x##+ :##W###@#W+ '); - writeln(' ;x@@@@@WzzzM@@@@@WMMMMMn++#+++###MWWWWWWW@@@@@@@@@WWx :@@W` i##W x##* *##W :@@W###@@@n, '); - writeln(' .n@@@@@@@WzzzznM@@@@@WMMz+++#+++###WWWWW@@@@@@@@@@@@@@* ,W@n` i##W .@##:.:###: :WW#:ii*n@x#` '); - writeln(' ,W@@@@@@@@Mzzzzzzznnxxxz++++++++###nWWW@@@@@@@@@@@@@@@MM; :W#W` i##W *#@Wz###### ,zMM` `WM#; '); - writeln(' x@@@@@@@@@xzzzzzzzz++++++++++++++##MWW@@@@@@WiM@@@@@WMM@i :@@W` +##M M@##W#####W`,xWW` `W#M* '); - writeln(' i@@@@@@@@@@Mzzzzzzz#++++++++++++++#nWW@@@@@nz@*M@@@@MMMWx` :@#W...;@##z,@@#i###z###;:@@M...,*x+M: '); - writeln(' `W@@@@@@@@@@WMzzzzzz#++++++++++++++M@@@@@@@@#+@@@@@WMMMWn` :#@W*M@###@,*@@W` W##z,@#W#WWW@W@i '); - writeln(' i@@@@@@@@@@@MnMnzzzz#+++++++++++++#@@@@@@@@@@@Wiz@MMMMWW.,;*+zz, ,@WM#####@i +@xz z##@:@@M#@@@W#M, '); - writeln(' x@@@@@@@@xW@#zznn###+++++##zzz++++z@@@@@@@@+z@++;xMMWWWMMMMMWWW* .+++;##+i. ;#+: :###:++*;#+**,` '); - writeln(' :@@@@@@@WiiWz;zz##z######znxxz+++++n@@@@@@@@zxWi*xMMMMMMMMWWWWM+. '); - writeln(' #@@@@@@Wi;Wn;zxzz######znnzz#++++++x@@@@@@@@@@MxMMMMMMMMWWWWW#*+: '); - writeln(' `W@@@@@Wi:Mx:+Mi#zzzz######++++++++z@@@@@@@@@@@MMMMMMWWWWMMMMW@WWM '); - writeln(' ;@@@@WWMnWz;*Mi;nzzz###++++++++++#x@@@@@@@@@@WMMMMMMMMMMMMMMWWWWMi '); - writeln(' n@@@@i`.,+MMWi;x@nzz###++++++++++W@@@@@@@@@WMMMMMMMMMMMMMMWWWx+;` '); - writeln(' i@@@@n.iii,.#z:x@@Wz###++++++++++M@@@@@@@@WMMMMMMMMMMMMMMWWz;. '); - writeln(' M@@@@;:+,,**.;M@@@@nz##+++++++++n@@@@@@WWMMMMMMMMMMMMMMMW#. '); - writeln(' W@@@M``:+i.:*,z@@@@Wzz####+++++#@@@@@@WMMMMMMMMMMMMMMMWWW. '); - writeln(' W@@@M:```:iii:@@@@@@nzzzz++++++M@@WWMMW@MMMMMMMMMMMMMWWWW, '); - writeln(' .@@@@@@z:`````*@@@@@@Wz###++#++x@MMMMMMMMMMMMMMMMMMMMWWMzW; `,.,` ::: ,::. '); - writeln(' xW+ii+zW@xi```x@@@@@@@@z#####+nxnnxMMMMMMMWMMMMMMMMMWWx;;W* .z@#+#@z. `x##i x#@* '); - writeln(' ;n;;i;:::iz@x::@@@@@@@@@@z##########MMMMMMM@MMMMMMMWWWM;:;M# :W###+###W: ,+@#W. x@#* '); - writeln(' *#zz##+*i;:;#WM@@@@@@Wxnz###########xMMMMMMWMMMMMWWWW#;;x;Mz .@##@#.+@##@.,W#### x#@* '); - writeln(' ;####++++++i;:i@@WMnz################nMMMMMMWWMMWWW@Wx::n@:Wn ###W, .W##z,#+MWx, ###* '); - writeln(' .#####++++++++**zz#####################MMMMMM@WMWW@MnnW::MM:WM `W##* ;#@x.#*;x#* n##* '); - writeln(' ;####++++++############################MMMMW@@WWWWz;:;z*:##*WM` ,##@. `W+M:nn*izWi n##* '); - writeln(' `####+++################################xMMW@WWWWW#:*+;;+:::xWW. :@nW` #xM;WWW,@@W`n##* '); - writeln(' ,#############z#######################xWW@@WWWWWWx;*W#;z+:+MWWW; ,Wxx` x@W;@W@ +###z##* '); - writeln(' i##################################zM@@@WWWW@@WMW+;;;#x++:nWWWW* .nxW, `W@#i##@``W#@*##* '); - writeln(' `#################################nM@WWWWWMM@Wz***;;;Mx;z*iMWWWW# `zxW# i@#W,##@` ;##xz#* '); - writeln(' ,###############################nM@@@W@@W+*nW++n+**:;*;iWzMWWWWWn *@@W; :W@#*,##@` n##+W* '); - writeln(' i#############################nM@@@@@@@@n**x#*xn+xM;::iM@WWWW@WWx `n@W@+`+###M`,##@` ,@#W+* '); - writeln(' +###########################nM@@@@@@@@@@z**x**+nn#WMzx@@WWWW@@WWM .n@@M,M##x. ,##@` +###; '); - writeln(' ##########################nM@@@@@W++#@@@+*+n**n+#W@@@@WWWW@@@WWWM` `iz*;Wxi` ,@@@` `x@W, '); - writeln(' ########################nM@@@@@@@W**+nMz**nM**+nW@@@WWWWW@@@@WWWW` ` ``` ``` '); - writeln(' +#####################zx@@@@@@@@@@n+****#n@@WW@@@@@WWWW@@@@@WWWWW` '); - writeln(' ;###################zxW@@@@@@@WWW@@@WMMW@@@@@@@@WWWWW@@@@@@@WWWWW. '); - writeln(' `zzz##############znW@@@@@@@@@@@WWWWWWWWWWWWWWWWWW@@@@@@@@@WW@WWW, '); - writeln(' inn#########zzznxM@@@@@@@@@@@@@@@@@WWWWWWWWWWW@@@@@@@@@@@WWW@WWW: '); - writeln(' .znnzzzznnnnn#i;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWW@WWWW* '); - writeln(' innnnnnz+i:. .@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWW@@@@@@@WWWW@WWWWz '); - writeln(' `*nnzi,` ,@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWWWWWWW@@WWWWM '); - writeln(' .. ,@@@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWWWWWWWW@WWWWWW. '); - writeln(' ,@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWWW@@@WWWWWW, '); - writeln(' ,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWW@` ,*nnixMxMxM,zMM: zMM: '); - writeln(' .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWW@i .*Wx+@##@@#:+##M` i##x: '); - writeln(' `@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWW@W@W. `x@x*xMxMMM,Mn##* `W#@+* '); - writeln(' n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWW@@# ,#MM` `##@#W. +@##W* '); - writeln(' ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWW@W@@@W, .+zW` `M*;x## .xMx##+ '); - writeln(' `W@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWW@WW@WW@# ,#xx,;ii;i,`zxi*i+: n@W#@#* '); - writeln(' `W@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWW@WW@WWW@W` :xxWiM@#@xz`nxM;@@x` i@@x###+ '); - writeln(' ,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWW@@WWWWWW@@; :xn#iW@#W#n`WW@.z##*`W#@,z##+ '); - writeln(' ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWW@@WWWWWWW@@# :nMW.,:,::.`@@#..@#W*### n##+ '); - writeln(' :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWW@@WWWWWWW@@@x :@@x` `###. *#@*#W` z##* '); - writeln(' `M@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWW@@WWWWWWWW@@@W` :W@x` `###. `M@*#i ###* '); - writeln(' z@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWW@@@@WWWWWWW@@@@@, :@#W`,::,:,.###. :W*x x##* '); - writeln(' #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWW@@@@WW@WWWW@@@@@@: ,xMn,x@@@@@;###. #*, x@#* '); - writeln(' :@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWW@@@@@WW@WWWW@@@@@@@; ,+;M*+WMM@W;###. `` x#@* '); - writeln(' `M@@@@@@@@@@@@@@@WWWWWWWWW@@@@@@@@@@@@@WW@WWW@@@@@@@@@: `.,;,::;i**,i**` ;**, '); - writeln(' z@@@@@@@@@@@@@@@@WWW@@@@@@@@@@@@@@@@@WW@WWW@@@@@@@@@@z` '); - writeln(' ;M@@@@@@@@@@@@@@WW@@@@@@@@@@@@@@@@@WWW@WW@@@@@@@@@@xi '); - writeln(' .M@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWW@@@@@@@@@@@@M+, '); - writeln(' :nW@@@@@@@@@@@@@@@@@@@@@@@@@@WWW@@@@@@@@@WWni. '); - writeln(' .;+nW@@@@@@@@@@@@@@@@@@@WWW@@@@@@MMn*:` '); - writeln(' `;+nM@@@@@Wx##+#+#++#+#+#+++:` '); - writeln(' `:##*:` '); - writeln(''); - writeln(' MAXIMIZE A TELA :)'); - readkey; - end; - - -End. diff --git a/sample/pascal-master/.tictactoe_freepascal.pas.swp b/sample/pascal-master/.tictactoe_freepascal.pas.swp deleted file mode 100644 index 6c97cfb9..00000000 Binary files a/sample/pascal-master/.tictactoe_freepascal.pas.swp and /dev/null differ diff --git a/sample/pascal-master/2048.pas b/sample/pascal-master/2048.pas deleted file mode 100644 index b8285269..00000000 --- a/sample/pascal-master/2048.pas +++ /dev/null @@ -1,325 +0,0 @@ -{ - * A 2048 clone in Old pascal using Allegro.pas - * Made by Mohamed Aziz Knani - * medazizknani[at]gmail.com - * http://mohamedazizknani.wordpress.com -} -program Game2048; -{$H+} -uses Allegro5, Al5primitives, Al5font, Al5ttf; -type - direction = (L, R, U, D, N); { - Left, Right, Up, Down and None - } - Game = record - Board : array [1..4, 1..4] of LongInt; - full, next : boolean; - dir : direction; - score : LongInt; - end; -var - Display : ALLEGRO_DISPLAYptr; - box_x, box_y : integer; - PGame : Game; - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - Closed : boolean; -{Just to use it as one liner instead of using the Ugly pascal procedure} -function IntToStr(int : Longint) : string; -Var - st : string; -begin - Str(int, st); - IntToStr := st; -end; - -procedure Draw(PGame : game); -var - Font1, Font2 : ALLEGRO_FONTptr; - j, k, i : byte; - Color : ALLEGRO_COLOR; - -begin - {Drawing the cells} - al_clear_to_color(al_map_rgb(187, 173, 160)); - Font1 := al_load_font('Consolas.ttf', 32, 0); - box_y := -100; - box_x := 0; - j:=0; - k:=0; - for i:=0 to 15 do begin - box_x := box_x + 110; - Inc(k); - if (i mod 4 = 0) then begin - box_x := 30; - box_y := box_y + 110; - Inc(j); - k:=1; - end; - case PGAME.Board[j, k] of - 0 : Color := al_map_rgb(204,192,179); - 2, 4 : Color := al_map_rgb(238,228,218); - 8, 16, 32, 64 : Color := al_map_rgb(242,177,121); - 128, 256, 512 : Color := al_map_rgb(220,155,27); - else Color := al_map_rgb(0,0,0); - end; - al_draw_filled_rounded_rectangle(box_x, box_y, box_x+100, box_y+100, 10, 10, Color); - if (PGame.board[j, k] <>0) then - al_draw_text(Font1, al_map_rgb(119, 110, 110), box_x+50, box_y+40, ALLEGRO_ALIGN_CENTRE, IntToStr(PGame.board[j, k])); - end; - {Drawing score} - Font2 := al_load_font('Consolas.ttf', 32, 0); - al_draw_text(Font2, al_map_rgb(104, 104, 104), 10, 460, ALLEGRO_ALIGN_LEFT, concat('Score : ', IntToStr(PGame.Score))); - al_flip_display(); -end; - -procedure spawnTile(var PGame : Game); - function rand(x, y : byte) : byte; - Var - r : byte; - begin - randomize(); - r := random(2); - if r=0 then rand := x - else rand:=y; - end; -Var - x, y : byte; -begin - randomize(); - repeat - x:=random(4)+1; - y:=random(4)+1; - until PGame.board[x, y] = 0; - PGame.board[x, y] := rand(2, 4); -end; - -procedure Pfull(var PGame : Game); -var - bool : boolean; - i, j : byte; -begin - bool := True; - for i:=1 to 4 do - for j:=1 to 4 do - if PGame.board[i, j] = 0 then bool := False; - PGame.full := bool; -end; - -procedure Pnext(var PGame : Game); -Var - bool : boolean; - i, j : byte; -begin - bool := False; - for i:=1 to 4 do - for j:=1 to 3 do - if (PGame.board[j, i]<>0) and (PGame.board[j, i]=PGame.board[j+1, i]) then bool := True - else if (PGame.board[i, j]<>0) and (PGame.board[i, j]=PGame.board[i, j+1]) then bool:=True; - for i:=1 to 4 do - for j:=4 Downto 2 do - if (PGame.board[j, i]<>0) and (PGame.board[j, i]=PGame.board[j-1, i]) then bool := True - else if (PGame.board[i, j]<>0) and (PGame.board[i, j]=PGame.board[i, j+1]) then bool := True; - - PGame.next :=bool; -end; - -procedure mainGame(var PGame : Game); - - procedure movingUp(var PGame : Game); - var - i, j, k : byte; - begin - for i:=1 to 4 do - for j:=1 to 4 do begin - if (PGame.board[j, i] = 0) then - for k:=j+1 to 4 do - if (PGame.board[k, i]<>0) then begin - PGame.board[j, i] := PGame.board[k, i]; - PGame.board[k, i] := 0; - break; - end; - end; - end; - - procedure movingDown(var PGame : Game); - var - i, j, k : byte; - begin - for i:=1 to 4 do - for j:=4 Downto 1 do begin - if (PGame.board[j, i] = 0) then - for k:=j-1 Downto 1 do - if (PGame.board[k, i]<>0) then begin - PGame.board[j, i] := PGame.board[k, i]; - PGame.board[k, i] := 0; - break; - end; - end; - end; - - procedure movingLeft(var PGame : Game); - var - i, j, k : byte; - begin - for i:=1 to 4 do - for j:=1 to 4 do begin - if (PGame.board[i, j] = 0) then - for k:=j+1 to 4 do - if (PGame.board[i, k]<>0) then begin - PGame.board[i, j] := PGame.board[i, k]; - PGame.board[i, k] := 0; - break; - end; - end; - end; - - procedure movingRight(var PGame : Game); - var - i, j, k : byte; - begin - for i:=1 to 4 do - for j:=4 Downto 1 do begin - if (PGame.board[i, j] = 0) then - for k:=j-1 Downto 1 do - if (PGame.board[i, k]<>0) then begin - PGame.board[i, j] := PGame.board[i, k]; - PGame.board[i, k] := 0; - break; - end; - end; - end; - - procedure updateUp(var PGame : Game); - var - i, j : byte; - begin - for i:=1 to 4 do - for j:=1 to 3 do begin - if (PGame.board[j, i]<>0) and (PGame.board[j, i]=PGame.board[j+1, i]) then begin - PGame.score+=PGame.board[j+1, i]*2; - PGame.board[j, i]+=PGame.board[j+1, i]; - PGame.board[j+1][i]:=0; - break; - end; - end; - end; - - procedure updateDown(var PGame : Game); - var - i, j : byte; - begin - for i:=1 to 4 do - for j:=4 Downto 2 do begin - if (PGame.board[j, i]<>0) and (PGame.board[j, i]=PGame.board[j-1, i]) then begin - PGame.score+=PGame.board[j-1, i]*2; - PGame.board[j, i]+=PGame.board[j-1, i]; - PGame.board[j-1][i]:=0; - break; - end; - end; - end; - - procedure updateRight(var PGame : Game); - var - i, j : byte; - begin - for i:=1 to 4 do - for j:=4 Downto 2 do begin - if (PGame.board[i, j]<>0) and (PGame.board[i, j]=PGame.board[i, j-1]) then begin - PGame.score+=PGame.board[i, j-1]*2; - PGame.board[i, j]+=PGame.board[i, j-1]; - PGame.board[i, j-1]:=0; - break; - end; - end; - end; - - procedure updateLeft(var PGame : Game); - var - i, j : byte; - begin - for i:=1 to 4 do - for j:=1 to 3 do begin - if (PGame.board[i, j]<>0) and (PGame.board[i, j]=PGame.board[i, j+1]) then begin - PGame.score+=PGame.board[i, j+1]*2; - PGame.board[i, j]+=PGame.board[i, j+1]; - PGame.board[i, j+1]:=0; - break; - end; - end; - end; - -begin - {The moving and updating part} - // this is chandruscm's algorithm simple and powerful (Written in C++) ! - case PGame.dir of - U : begin - movingUp(PGame); - updateUp(PGame); - end; - D : begin - movingDown(PGame); - updateDown(PGame); - end; - L : begin - movingLeft(PGame); - updateLeft(PGame); - end; - R : begin - movingRight(PGame); - updateRight(PGame); - end; - end; -end; - -BEGIN - { init the PGame record} - with PGame do begin - Score := 0; - full := False; - next := True; - spawnTile(PGame); - spawnTile(PGame); - end; - al_init(); - al_init_font_addon(); - al_init_primitives_addon(); - al_init_ttf_addon(); - al_install_keyboard(); - Display := al_create_display(500, 500); - al_set_window_title(Display, '2048'); - event_queue := al_create_event_queue(); - al_register_event_source(event_queue, al_get_keyboard_event_source); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - Draw(PGame); - Closed:=False; - while not(Closed) or not(PGame.next) do begin - al_wait_for_event(event_queue, ev); - if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then - case ev.keyboard.keycode of - ALLEGRO_KEY_UP : PGame.dir := U; - ALLEGRO_KEY_DOWN : PGame.dir := D; - ALLEGRO_KEY_LEFT : PGame.dir := L; - ALLEGRO_KEY_RIGHT : PGame.dir := R; - else PGame.dir := N; - end - else if (ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE) then Closed := True; - if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then begin - if PGame.dir <> N then begin - mainGame(PGame); - if not(PGame.full) then - spawnTile(PGame); - end; - Pfull(PGame); - Draw(PGame); - Pnext(PGame); - end; - end; - if not(PGame.next) then begin - al_draw_filled_rounded_rectangle(50, 50, 450, 450, 10, 10, al_map_rgb(255, 223, 223)); - al_draw_text(al_load_font('Consolas.ttf', 52, 0), al_map_rgb(119, 110, 110), al_get_display_width(display)/2, al_get_display_height(display)/2, ALLEGRO_ALIGN_CENTRE, 'Game Over!'); - al_flip_display(); - end; - al_destroy_display(Display); -END. diff --git a/sample/pascal-master/LICENSE.md b/sample/pascal-master/LICENSE.md deleted file mode 100644 index fb650de7..00000000 --- a/sample/pascal-master/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 mohamed aziz knani - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/sample/pascal-master/Makefile b/sample/pascal-master/Makefile deleted file mode 100644 index b3352cf9..00000000 --- a/sample/pascal-master/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -all: - fpc 2048.pas diff --git a/sample/pascal-master/README.md b/sample/pascal-master/README.md deleted file mode 100644 index c591ddee..00000000 --- a/sample/pascal-master/README.md +++ /dev/null @@ -1 +0,0 @@ -my pascal code snippets and projects diff --git a/sample/pascal-master/basicsprite/conv.sh b/sample/pascal-master/basicsprite/conv.sh deleted file mode 100644 index 7b32fb88..00000000 --- a/sample/pascal-master/basicsprite/conv.sh +++ /dev/null @@ -1,5 +0,0 @@ - -for file in `ls` -do - convert $file -resize 154x105 $file -done diff --git a/sample/pascal-master/basicsprite/frame-1.png b/sample/pascal-master/basicsprite/frame-1.png deleted file mode 100644 index af091624..00000000 Binary files a/sample/pascal-master/basicsprite/frame-1.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-2.png b/sample/pascal-master/basicsprite/frame-2.png deleted file mode 100644 index 027014a6..00000000 Binary files a/sample/pascal-master/basicsprite/frame-2.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-3.png b/sample/pascal-master/basicsprite/frame-3.png deleted file mode 100644 index 6c1c9003..00000000 Binary files a/sample/pascal-master/basicsprite/frame-3.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-4.png b/sample/pascal-master/basicsprite/frame-4.png deleted file mode 100644 index d63c75d7..00000000 Binary files a/sample/pascal-master/basicsprite/frame-4.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-5.png b/sample/pascal-master/basicsprite/frame-5.png deleted file mode 100644 index 6a564348..00000000 Binary files a/sample/pascal-master/basicsprite/frame-5.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-6.png b/sample/pascal-master/basicsprite/frame-6.png deleted file mode 100644 index d3af584e..00000000 Binary files a/sample/pascal-master/basicsprite/frame-6.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-7.png b/sample/pascal-master/basicsprite/frame-7.png deleted file mode 100644 index 1ff747cb..00000000 Binary files a/sample/pascal-master/basicsprite/frame-7.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/frame-8.png b/sample/pascal-master/basicsprite/frame-8.png deleted file mode 100644 index 4bac307f..00000000 Binary files a/sample/pascal-master/basicsprite/frame-8.png and /dev/null differ diff --git a/sample/pascal-master/basicsprite/sprite b/sample/pascal-master/basicsprite/sprite deleted file mode 100644 index 654b78b4..00000000 Binary files a/sample/pascal-master/basicsprite/sprite and /dev/null differ diff --git a/sample/pascal-master/basicsprite/sprite.pas b/sample/pascal-master/basicsprite/sprite.pas deleted file mode 100644 index 4f5f6bc3..00000000 --- a/sample/pascal-master/basicsprite/sprite.pas +++ /dev/null @@ -1,86 +0,0 @@ - -uses Allegro5, Al5image, sysutils; - -Const - FPS = 60; - frame_delay = 10; - -Var - Display : ALLEGRO_DISPLAYptr; - Sprites : array [1..8] of ALLEGRO_BITMAPptr; - cond : boolean; - timer : ALLEGRO_TIMERptr; - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - frame_count, curr_frame, i : byte; - deg: integer; - rad, y, x, s : real; - Up, Down, redraw - : Boolean; - -BEGIN - s := 3; - curr_frame := 1; - frame_count := 0; - x := 100; - cond := True; - al_init(); - al_init_image_addon(); - al_install_keyboard(); - Display := al_create_display(700, 300); - timer := al_create_timer(1.0/FPS); - event_queue := al_create_event_queue(); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - al_register_event_source(event_queue, al_get_timer_event_source(timer)); - al_register_event_source(event_queue, al_get_keyboard_event_source()); - al_start_timer(timer); - - for i:=1 to 8 do - Sprites[i] := al_load_bitmap('frame-'+InttoStr(i)+'.png'); - - while cond do begin - al_wait_for_event(event_queue, ev); - - if (ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE) then cond := False - else if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then - case ev.keyboard.keycode of - AlLEGRO_KEY_UP : Up := True; - ALLEGRO_KEY_DOWN : Down := True; - end - else if (ev._type = ALLEGRO_EVENT_KEY_UP) then - case ev.keyboard.keycode of - AlLEGRO_KEY_UP : Up := False; - ALLEGRO_KEY_DOWN : Down := False; - end - else if (ev._type = ALLEGRO_EVENT_TIMER) then begin - if Up then deg -= 10 - else if Down then deg += 10; - rad := deg * pi /180; - { works great for collision } - if cos(rad) >= 0 then x += cos(rad)*s; - y += sin(rad)*s; - if (frame_count >= frame_delay ) then begin - curr_frame := curr_frame +1; - if (curr_frame > 8) then curr_frame := 1; - frame_count := 0; - end; - frame_count := frame_count +1; - // x := x+4; - if (700 <= x) then x := -105; - redraw := True; - if redraw and al_is_event_queue_empty(event_queue) then begin - al_clear_to_color(al_map_rgb(122, 128, 160)); - al_draw_rotated_bitmap(Sprites[curr_frame], 154 / 2, 105 / 2, x , y, rad , 0); - al_flip_display(); - redraw := False; - end; - end; - - end; - - for i:=1 to 8 do - al_destroy_bitmap(Sprites[i]); - al_destroy_event_queue(event_queue); - al_destroy_timer(timer); - al_destroy_display(Display); -END. diff --git a/sample/pascal-master/breakout/breakout b/sample/pascal-master/breakout/breakout deleted file mode 100644 index 79d46291..00000000 Binary files a/sample/pascal-master/breakout/breakout and /dev/null differ diff --git a/sample/pascal-master/breakout/breakout.pas b/sample/pascal-master/breakout/breakout.pas deleted file mode 100644 index 09a65123..00000000 --- a/sample/pascal-master/breakout/breakout.pas +++ /dev/null @@ -1,142 +0,0 @@ -program Breakout; -uses Allegro5, Al5primitives; -Const - FPS = 60; - length_paddle = 100; -type - Colors = (RED, WHITE, BLUE, YELLOW, GREEN, NONE); - Ball = record - BallX, BallY, BallS, BallD : integer; - end; - - Paddle = record - Posx : integer; - Ldir, Rdir : boolean; - end; - - Blocks = array [1..5, 1..10] of Colors; -Var - Display : ALLEGRO_DISPLAYptr; - PBall : Ball; - PPaddle : Paddle; - PBlocks : Blocks; - PColors : Colors; -procedure init; -var - i, j : byte; -begin - al_init(); - al_init_primitives_addon(); - al_install_keyboard(); - PPaddle.Posx := 300; - PBall.BallX := 350; - PBall.BallY := 645; - PBall.BallD := 290; - PBall.BallS := 10; - { - for i:=1 to 5 do - for j:=1 to 10 do - PBlocks[i, j] := WHITE; - } - PBlocks[1, 1] := RED; PBlocks[1, 2] := YELLOW; PBlocks[1, 3] := RED; PBlocks[1, 4] := RED; PBlocks[1, 5] := RED; PBlocks[1, 6] := RED; PBlocks[1, 7] := RED; PBlocks[1, 8] := RED; PBlocks[1, 9] := RED; PBlocks[1, 10] := RED; -end; - -procedure GameLoop(PBall : Ball; PPaddle : Paddle); - - procedure Draw(PPaddle : Paddle; PBall : Ball); - var - i, j : byte; - Color : ALLEGRO_COLOR; - begin - al_clear_to_color(al_map_rgb(0, 0, 0)); - // Draw the Paddle - al_draw_line(PPaddle.Posx, 680, PPaddle.Posx+length_paddle, 680, al_map_rgb(255, 255, 255), 30 ); - - // Draw ball - al_draw_filled_rectangle(PBall.BallX, PBall.BallY, PBall.BallX+20, PBall.BallY+20, al_map_rgb(255, 255, 255)); - for i:=1 to 5 do - for j:=0 to 9 do - if PBlocks[i, j+1] <> NONE then begin - case PBlocks[i, j+1] of - RED : Color := al_map_rgb(220, 0, 0); - WHITE : Color := al_map_rgb(255, 255, 255); - BLUE : Color := al_map_rgb(17, 44, 214); - YELLOW : Color := al_map_rgb(246, 246, 10); - GREEN : Color := al_map_rgb(139, 105, 20); - end; - al_draw_line(j*70+10, i*50, j*70+75, i*50, Color, 30 ); - end; - al_flip_display(); - end; -Var - timer : ALLEGRO_TIMERptr; - redraw, Closed : boolean; - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - i, j : byte; -begin - Closed := False; - event_queue := al_create_event_queue(); - timer := al_create_timer(1.0/FPS); - al_register_event_source(event_queue, al_get_keyboard_event_source); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - al_register_event_source(event_queue, al_get_timer_event_source(timer)); - al_start_timer(timer); - While not(Closed) do begin - al_wait_for_event(event_queue, ev); - if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then - case ev.keyboard.keycode of - ALLEGRO_KEY_LEFT : PPaddle.Ldir := True; - ALLEGRO_KEY_RIGHT : PPaddle.Rdir := True; - end - else if (ev._type = ALLEGRO_EVENT_KEY_UP) then - case ev.keyboard.keycode of - ALLEGRO_KEY_LEFT : PPaddle.Ldir := False; - ALLEGRO_KEY_RIGHT : PPaddle.Rdir := False; - end - else if (ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE ) then Closed := True - else if (ev._type = ALLEGRO_EVENT_TIMER) then begin - if PPaddle.Ldir and (PPaddle.Posx-10>=10) then PPaddle.Posx -= 10 - else if PPaddle.Rdir and (PPaddle.Posx+10+length_paddle<=690) then PPaddle.Posx +=10; - with PBall do begin - Ballx += trunc(cos(Pi / 180 * BallD)*BallS); - BallY += trunc(sin(Pi / 180 * BallD)*BallS) ; - end; - if (PBall.BallX <= 20) or (PBall.BallX >= 680) then PBall.BallD += (90 - PBall.BallD)*2; - if (PBall.BallY <= 0) then PBall.BallD += (180 - PBall.BallD) *2; - // Cheking Collision With the paddle - if ((PBall.BallY >= 650) and (PBall.BallY<=660)) - and ((PBall.BallX+20 >= PPaddle.Posx) and (PBall.BallX+20<= PPaddle.Posx+length_paddle)) then begin - PBall.BallD += (180 - PBall.BallD - random(4)) *2; // adding some randomness :3 - if (PBall.BallX in [PPaddle.Posx..PPaddle.Posx+40]) or (PBall.BallX in [PPaddle.Posx+60..PPaddle.Posx+length_paddle]) then PBall.BallS := 18 - else PBall.BallS := 10; - end; - // Check collision with blocks - // I didn't use The power of maths but this works (it's Ugly and slow); - for i:=1 to 5 do - for j:=0 to 9 do - // So the Ball Was hit - if (((PBall.BallX >= j*70+10) and (PBall.BallX <= j*70+75)) and ((PBall.BallY >=i*50) and (PBall.BallY <=i*50+10))) and (PBlocks[i, j+1]<>NONE)then begin - // hit from the below or above - if (PBall.BallY <= i*50+10) or (PBall.BallY >= i) then - PBall.BallD += (180 - PBall.BallD) *2 - // hit from the sides - else if (PBall.BallX <= j*70+10) or ((PBall.BallX <= j*70+75)) then - PBall.BallD += (90 - PBall.BallD) *2; - PBlocks[i, j+1] := NONE; - end; - redraw := True; - end; - if redraw and al_is_event_queue_empty(event_queue) then begin - Draw(PPaddle, PBall); - redraw := False; - end; - end; -end; - -BEGIN - init; - Display := al_create_display(700, 700); - al_set_window_title(Display, 'Crazy Breakout'); - GameLoop(PBall, PPaddle); -END. diff --git a/sample/pascal-master/fusion.pas b/sample/pascal-master/fusion.pas deleted file mode 100644 index 53f9fa2f..00000000 --- a/sample/pascal-master/fusion.pas +++ /dev/null @@ -1,11 +0,0 @@ - -(* - *Algorithme de fusion - *) -type - tab -procedure Fusion(var t :tab; - t1, t2 : tab); -begin - -end; diff --git a/sample/pascal-master/hashCracker.pas b/sample/pascal-master/hashCracker.pas deleted file mode 100644 index 494c0ebb..00000000 --- a/sample/pascal-master/hashCracker.pas +++ /dev/null @@ -1,22 +0,0 @@ -program md5Cracker; -uses md5; - -var - wline, hline, wl, hf: string; - wordlist, hashFile : textfile; -begin - write('Enter Hash File > ');readln(hf); - write('Enter Wordlist > ');readln(wl); - assign(hashFile, hf); - reset(hashFile); - assign(wordlist, wl); - reset(wordlist); - repeat - readln(hashFile, hline); - repeat - readln(wordlist, wline); - if (MD5Print(MD5String(wline)) = hline) then - writeln('[+] Cracked :', hline, ' -> ', wline); - until EOF(wordlist); - until EOF(hashFile); -end. diff --git a/sample/pascal-master/physics/ball b/sample/pascal-master/physics/ball deleted file mode 100644 index eb742892..00000000 Binary files a/sample/pascal-master/physics/ball and /dev/null differ diff --git a/sample/pascal-master/physics/ball.pas b/sample/pascal-master/physics/ball.pas deleted file mode 100644 index 6423e85b..00000000 --- a/sample/pascal-master/physics/ball.pas +++ /dev/null @@ -1,73 +0,0 @@ -program ball1; - -uses Allegro5, Al5primitives; -const - FPS = 120; - Gravity = 9.8; - SurfaceWeight = 60000000; - accx = 12; -type - Ball = record - xp, yp, vx, vy, mass : real; - end; -var - Display : ALLEGRO_DISPLAYptr; - timer : ALLEGRO_TIMERptr; - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - redraw : Boolean; - B : Ball; - oldVy, dt, oldFps, newFps : Real; - i : integer; -BEGIN - B.vx := -20; B.vy := 0; B.xp:= 100; B.yp := 10; - i:=0; - B.mass := 60000; - al_init(); - al_init_primitives_addon(); - Display := al_create_display(700, 500); - timer := al_create_timer(1/FPS); - event_queue := al_create_event_queue(); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - al_register_event_source(event_queue, al_get_timer_event_source(timer)); - al_start_timer(timer); - dt := al_get_timer_speed(timer) * 10; - - oldFps := al_get_timer_count(timer); - while True do begin - al_wait_for_event(event_queue, ev); - Inc(i); - Writeln((al_get_timer_count(timer))); - if ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE then Break - else if ev._type = ALLEGRO_EVENT_TIMER then begin - - redraw := True; - (* The Juicy part the physics*) - oldVy := B.vy; - B.vy += Gravity * dt; - B.vx += accx * dt; - (* I use verlet algorithm*) - B.xp += B.vx * dt +0.5*accx*(dt*dt); - B.yp += B.vy * dt +0.5*Gravity*(dt*dt); - if B.yp+10>=500 then begin - B.vy := ((abs(B.vy)*(B.mass-SurfaceWeight)) / (B.mass+SurfaceWeight)); - B.vy := round(B.vy); - end - else if (B.xp+10>=700) or (B.xp<=10) then begin - b.Vx *= -1; - B.vx := round(B.vx); - end; - - if redraw and al_is_event_queue_empty(event_queue) then begin - al_clear_to_color(al_map_rgb(0, 0, 0)); - al_draw_filled_circle(B.xp, B.yp, 10, al_map_rgb(255, 255, 0)); - al_flip_display(); - redraw := False; - end; - - end; - end; - al_destroy_event_queue(event_queue); - al_destroy_timer(timer); - al_destroy_display(Display); -END. diff --git a/sample/pascal-master/pong/alterebro-pixel-font.ttf b/sample/pascal-master/pong/alterebro-pixel-font.ttf deleted file mode 100644 index b47b3634..00000000 Binary files a/sample/pascal-master/pong/alterebro-pixel-font.ttf and /dev/null differ diff --git a/sample/pascal-master/pong/pong b/sample/pascal-master/pong/pong deleted file mode 100644 index d687eaaa..00000000 Binary files a/sample/pascal-master/pong/pong and /dev/null differ diff --git a/sample/pascal-master/pong/pong.pas b/sample/pascal-master/pong/pong.pas deleted file mode 100644 index 00ab034d..00000000 --- a/sample/pascal-master/pong/pong.pas +++ /dev/null @@ -1,155 +0,0 @@ -{ - * An Atari pong clone in Old Pascal - * I called it Crazy Pong because of the weired bugs :3 - * This is what I call an ugly code but I commented it well - * Made by Mohamed Aziz Knani - * medazizknani[at]gmail.com - * mohamedazizknani.wordpress.com -} -program pong; -uses Allegro5, Al5primitives, Al5font, Al5ttf, SysUtils; -const - max_points = 10; - length_paddle = 100; - FPS = 60; // frame per second -Var - Display : ALLEGRO_DISPLAYptr; - scoreP1, scoreP2 : integer; // Player's score - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - Closed : boolean; - posP1, posP2 : integer; // represents the Y (vertical) position of each player - BallPx, BallPy, BallD, BallS : integer; // Ball position, direction and speed - p1UP, p1Do, p2UP, p2Do : boolean; // Player is Up or Down - timer : ALLEGRO_TIMERptr; - redraw : boolean; - i : byte; - chX, chY : integer; - Font1 : ALLEGRO_FONTptr; - -BEGIN - // init - al_init(); - al_init_primitives_addon(); - al_init_font_addon(); - al_init_ttf_addon(); - al_install_keyboard(); - scorep1 := 0; scorep2 := 0; - posP1 := 50; - posP2 := 120; - BallPx := 350; - BallPy := 250; - Closed := False; - BallD := 45; - BallS := 10; - - // Loading the font - Font1 := al_load_font('alterebro-pixel-font.ttf', 100, 0); - - // Setting Display - Display := al_create_display(700, 500); - al_set_window_title(Display, 'Crazy Pong'); - - // Setting the event Queue and timer - event_queue := al_create_event_queue(); - timer := al_create_timer(1.0/FPS); - al_register_event_source(event_queue, al_get_keyboard_event_source); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - al_register_event_source(event_queue, al_get_timer_event_source(timer)); - - // The Game loop - randomize; - al_start_timer(timer); - While not(Closed) or ((scorep1 = max_points) or (scorep2 = max_points)) do begin - al_wait_for_event(event_queue, ev); // wait for an event - if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then - case ev.keyboard.keycode of - ALLEGRO_KEY_UP : p2UP := True; - ALLEGRO_KEY_DOWN : p2Do := True; - ALLEGRO_KEY_A : p1UP := True; - ALLEGRO_KEY_Q : p1Do := True; - end - else if (ev._type = ALLEGRO_EVENT_KEY_UP) then - case ev.keyboard.keycode of - ALLEGRO_KEY_UP : p2UP := False; - ALLEGRO_KEY_DOWN : p2Do := False; - ALLEGRO_KEY_A : p1UP := False; - ALLEGRO_KEY_Q : p1Do := False; - end - else if (ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE ) then Closed := True - else if (ev._type = ALLEGRO_EVENT_TIMER) then begin - // Moving paddle - if p2UP and (posP2-10>=10) then posP2 -= 10 - else if P2Do and (posP2+10+length_paddle<=490) then posP2 += 10; - if p1UP and (posP1-10>=10) then posP1 -= 10 - else if P1Do and (posP1+10+length_paddle<=490) then posP1 += 10; - - // Moving with angles - chX := trunc(cos(Pi / 180 * BallD)*BallS); - chy := trunc(sin(Pi / 180 * BallD)*BallS); - BallPx += chX; - BallPY += chY; - - // Checking Collision with walls - //if (BallPX <= 20) or (BallPX >= 680-15) then BallD += (90 - BallD) *2; - if (BallPY <= 10) or (BallPY >= 470) then BallD += (180 - BallD) *2; - - // Cheking Collision With paddles - if ((BallPX >= 640) and (BallPX<=650)) - and ((BallPY >= posP2) and (BallPY<= posP2+length_paddle)) then begin - BallD += (90 - BallD - random(4)) *2; // adding some randomness :3 - // if the ball were hit in the sides accelerate the ball - if (BallPY in [posP2..posP2+40]) or (BallPY in [posP2+60..posP2+length_paddle]) then BallS := 18 - else BallS := 10; - end - else if ((BallPX<=40) and (BallPy>=30)) - and ((BallPY >= posP1) and (BallPY<= posP1+length_paddle)) then begin - BallD += (90 - BallD - random(4)) *2; // adding some randomness :3 - // if the ball were hit in the sides accelerate the ball - if (BallPY in [posP1..posP1+40]) or (BallPY in [posP1+60..posP1+length_paddle]) then BallS := 18 - else BallS := 10; - end; - if (BallPX>700) then begin - BallPx := 350; - BallPy := 250; - BallD := random(100)+140; - BallS := 7; - Inc(scorep1); - end - else if (BallPX<0) then begin - BallPx := 350; - BallPy := 250; - BallD := random(100)+330; - BallS := 7; - Inc(scoreP2); - end; - Writeln(BallPX); - redraw := True; - end; - if redraw and al_is_event_queue_empty(event_queue) then begin - // Draw board - al_clear_to_color(al_map_rgb(0, 0, 0)); - al_draw_line(10, 0, 690, 0, al_map_rgb(255, 255, 255), 20); - al_draw_line(10, 500, 690, 500, al_map_rgb(255, 255, 255), 20); - - // Draw Players - al_draw_line(30, PosP1, 30, PosP1+100, al_map_rgb(255, 255, 255), 30 ); // draw 1st player - al_draw_line(670, PosP2, 670, PosP2+100, al_map_rgb(255, 255, 255), 30 ); // draw 2nd player - al_draw_filled_rectangle(BallPx, BallPy, BallPx+20, BallPy+20, al_map_rgb(255, 255, 255)); - - // Draw the middle of the pitch - for i:=1 to 20 do - al_draw_line(350, i*24, 350, i*24+10, al_map_rgb(255, 255, 255), 10 ); - - // Draw Scores - al_draw_text(Font1, al_map_rgb(255, 255, 255), 280, 30, ALLEGRO_ALIGN_CENTER, IntToStr(scorep1)); - al_draw_text(Font1, al_map_rgb(255, 255, 255), 420, 30, ALLEGRO_ALIGN_CENTER, IntToStr(scorep2)); - - al_flip_display(); - redraw := False; - end; - end; - al_destroy_event_queue(event_queue); - al_destroy_timer(timer); - al_destroy_display(Display); -END. diff --git a/sample/pascal-master/school/.3_2009.pas.swp b/sample/pascal-master/school/.3_2009.pas.swp deleted file mode 100644 index 237acb30..00000000 Binary files a/sample/pascal-master/school/.3_2009.pas.swp and /dev/null differ diff --git a/sample/pascal-master/school/.Makefile.swn b/sample/pascal-master/school/.Makefile.swn deleted file mode 100644 index 0c77f026..00000000 Binary files a/sample/pascal-master/school/.Makefile.swn and /dev/null differ diff --git a/sample/pascal-master/school/.Makefile.swo b/sample/pascal-master/school/.Makefile.swo deleted file mode 100644 index 5f8c59fb..00000000 Binary files a/sample/pascal-master/school/.Makefile.swo and /dev/null differ diff --git a/sample/pascal-master/school/.Makefile.swp b/sample/pascal-master/school/.Makefile.swp deleted file mode 100644 index bc4ec43d..00000000 Binary files a/sample/pascal-master/school/.Makefile.swp and /dev/null differ diff --git a/sample/pascal-master/school/.bac_2008_10H.pas.swp b/sample/pascal-master/school/.bac_2008_10H.pas.swp deleted file mode 100644 index b0439914..00000000 Binary files a/sample/pascal-master/school/.bac_2008_10H.pas.swp and /dev/null differ diff --git a/sample/pascal-master/school/.counting_sort.pas.swp b/sample/pascal-master/school/.counting_sort.pas.swp deleted file mode 100644 index 18284cfa..00000000 Binary files a/sample/pascal-master/school/.counting_sort.pas.swp and /dev/null differ diff --git a/sample/pascal-master/school/.input.txt.swn b/sample/pascal-master/school/.input.txt.swn deleted file mode 100644 index 29d0a0da..00000000 Binary files a/sample/pascal-master/school/.input.txt.swn and /dev/null differ diff --git a/sample/pascal-master/school/.input.txt.swo b/sample/pascal-master/school/.input.txt.swo deleted file mode 100644 index 7acc3e78..00000000 Binary files a/sample/pascal-master/school/.input.txt.swo and /dev/null differ diff --git a/sample/pascal-master/school/.trifusion.pas.swo b/sample/pascal-master/school/.trifusion.pas.swo deleted file mode 100644 index 86384592..00000000 Binary files a/sample/pascal-master/school/.trifusion.pas.swo and /dev/null differ diff --git a/sample/pascal-master/school/.trifusion.pas.swp b/sample/pascal-master/school/.trifusion.pas.swp deleted file mode 100644 index 6768f721..00000000 Binary files a/sample/pascal-master/school/.trifusion.pas.swp and /dev/null differ diff --git a/sample/pascal-master/school/2010_pratique_1 b/sample/pascal-master/school/2010_pratique_1 deleted file mode 100644 index 5cfc4cb9..00000000 Binary files a/sample/pascal-master/school/2010_pratique_1 and /dev/null differ diff --git a/sample/pascal-master/school/2010_pratique_1.pas b/sample/pascal-master/school/2010_pratique_1.pas deleted file mode 100644 index b8ecfb47..00000000 --- a/sample/pascal-master/school/2010_pratique_1.pas +++ /dev/null @@ -1,94 +0,0 @@ - -program Pratique1; -Uses crt; -type - fi = file of Byte; -var - f : fi; - n : byte; - -procedure saisie(var n : byte; - var f: fi); -var - i : Byte; -begin - rewrite(f); - repeat - readln(n); - until (n in [3..50]); - randomize; - for i:=1 to n do begin - write(f, Random(9)+1) ; - {write(f, i) ;} - end; -end; - -procedure Permuter(var a, b : byte); -var - c : byte; -begin - c := a; - a := b; - b := c; -end; - -procedure traitement(var f: fi; - n : byte); -var - t : array [1..50] of Byte; - i, j : Byte; - gn, pn : String; - r, rp, u, up : Integer; - tr : Boolean; -begin - reset(f); - for i := 1 to n do begin - read(f, t[i]); - end; - - gn := ''; pn := ''; - { Tri a bulles mon preferes} - for i := 1 to n do - begin - for j := 1 to n-1 do - begin - if (t[j]<=t[j+1]) then begin - Permuter(t[j], t[j+1]); - end; - end; - pn := pn + Chr(48+t[n-i+1]); - gn := Chr(48+t[n-i+1]) + gn; - end; - Writeln('le plus grande composition : ', gn); - Writeln('le plus petite composition : ', pn); - {Est une suite de raison r ?} - - up := 0; - r := 0; - rp := r; - TR := True; - i := 0; - repeat - Inc(i); - u := t[i] - t[n-i+1]; - if (i<>1) then begin - rp := r; - r := u - up; - { On peut conclure SSI on atteint le troisieme terme } - if (r<>rp) and (i>=3) then TR := False; - end; - up := u; - until (i> n div 2) or not(TR); - if (TR) then begin - Writeln('Ils forment une suite arithmetique de r=', r); - end else - Writeln('Ils ne forment pas unse suite arithmetique puisque r',i-2,'<>r',i-1) -end; - -BEGIN - assign(f, 'Nombres.dat') ; - saisie(n, f); - traitement(f, n) ; - Close(f); -END. - diff --git a/sample/pascal-master/school/3_2009 b/sample/pascal-master/school/3_2009 deleted file mode 100644 index 855db960..00000000 Binary files a/sample/pascal-master/school/3_2009 and /dev/null differ diff --git a/sample/pascal-master/school/3_2009.pas b/sample/pascal-master/school/3_2009.pas deleted file mode 100644 index 336e2341..00000000 --- a/sample/pascal-master/school/3_2009.pas +++ /dev/null @@ -1,58 +0,0 @@ -{medazizknani@gmail.com} - -program DevoirTP; -Uses SysUtils, crt; -var - f : text; - p, q : LongInt; - -procedure Saisie(var p, q : LongInt); -begin - Readln(p); - Readln(q); -end; - -procedure Traitement(var f : text; p, q : LongInt); -var - i : LongInt; - st : string; - c, n : LongInt; -begin - Rewrite(f) ; - Writeln(f, p, ' ', q); - for i:=p to q do begin - n := i; - st := ''; - c := 2; - repeat - while (n mod c = 0) do begin - st := st + '.' + IntTostr(c); - n := n div c; - end; - c := c+1; - until (n=1); - Delete(st, 1, 1); - st := IntTostr(i) + '=' + st; - Writeln(f, st); - end; -end; - -procedure Affichage(var f : text); -var - st : string; -begin - reset(f) ; - while (not(EOF(f))) do begin - Readln(f, st); - Writeln(st); - end; - -end; - -BEGIN - assign(f, 'decomp.txt'); - Saisie(p , q) ; - Traitement(f, p, q); - Affichage(f); -END. - diff --git a/sample/pascal-master/school/3_2009.pdf b/sample/pascal-master/school/3_2009.pdf deleted file mode 100644 index 8090e024..00000000 Binary files a/sample/pascal-master/school/3_2009.pdf and /dev/null differ diff --git a/sample/pascal-master/school/Makefile b/sample/pascal-master/school/Makefile deleted file mode 100644 index 17ff6773..00000000 --- a/sample/pascal-master/school/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -COMPILER = fpc -DEBUGGER = gdb -OUTPUT = bac_2008_10H -FLAGS = -gl -o$(OUTPUT) -Mtp -#INPUT = < input.txt -SOURCE = bac_2008_10H.pas -all: $(SOURCE) - $(COMPILER) $(FLAGS) $(SOURCE) -run: all $(OUTPUT) - ./$(OUTPUT) $(INPUT) -debug: all - $(DEBUGGER) ./$(OUTPUT) diff --git a/sample/pascal-master/school/Nombres.dat b/sample/pascal-master/school/Nombres.dat deleted file mode 100644 index 6bbeba4d..00000000 --- a/sample/pascal-master/school/Nombres.dat +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sample/pascal-master/school/README.md b/sample/pascal-master/school/README.md deleted file mode 100644 index e69de29b..00000000 diff --git "a/sample/pascal-master/school/S\303\251rie 8.docx" "b/sample/pascal-master/school/S\303\251rie 8.docx" deleted file mode 100644 index 1ec26161..00000000 Binary files "a/sample/pascal-master/school/S\303\251rie 8.docx" and /dev/null differ diff --git a/sample/pascal-master/school/bac_2008_10H b/sample/pascal-master/school/bac_2008_10H deleted file mode 100644 index e594f569..00000000 Binary files a/sample/pascal-master/school/bac_2008_10H and /dev/null differ diff --git a/sample/pascal-master/school/bac_2008_10H.pas b/sample/pascal-master/school/bac_2008_10H.pas deleted file mode 100644 index 54bb8007..00000000 --- a/sample/pascal-master/school/bac_2008_10H.pas +++ /dev/null @@ -1,53 +0,0 @@ -program Bac08; -Uses crt; -var - f, f1 : text; - -procedure Saisie(var f : text); -var - s : string; - i, n : Integer; -begin - Rewrite(f) ; - Readln(n); - for i := 1 to n do begin - readln(s) ; - writeln(f, s); - end; -end; - -procedure Traitement(var f, f1 : text); - - function ch_Cor(s : string):string; - begin - while (Pos(' ', s)<>0) do begin - Delete(s, Pos(' ', s), 1); - end; - if (s[1]=' ') then Delete(s, 1, 1); - if (s[length(s)]=' ') then Delete(s, length(s), 1); - if (s[length(s)]<>'.') then s := s+'.'; - ch_Cor := s; - end; - -var - s, chaine_corrigee : String; -begin - reset(f) ; - Rewrite(f1); - while (not(EOF(f))) do begin - readln(f, s); - chaine_corrigee := ch_Cor(s); - Writeln(chaine_corrigee); - writeln(f1, chaine_corrigee); - end; -end; - -BEGIN - - assign(f, 'phrases.txt'); - assign(f1, 'phr_cor.txt'); - Saisie(f); - Traitement(f, f1); - close(f); - close(f1); -END. diff --git a/sample/pascal-master/school/counting_sort b/sample/pascal-master/school/counting_sort deleted file mode 100644 index a36b8bad..00000000 Binary files a/sample/pascal-master/school/counting_sort and /dev/null differ diff --git a/sample/pascal-master/school/counting_sort.pas b/sample/pascal-master/school/counting_sort.pas deleted file mode 100644 index b084797b..00000000 --- a/sample/pascal-master/school/counting_sort.pas +++ /dev/null @@ -1,49 +0,0 @@ - -type - tab = array ['A'..'Z'] of Byte; -var - s : string; - -procedure CountSort(var s : string); -var - t : tab; - i : char; - j : Byte; - k : String; -begin - for i := 'A' to 'Z' do begin - t[i] := 0; - end; - - for j := 1 to length(s) do begin - t[Upcase(s[j])] += 1; - end; - - {accumlate the array} - for i := 'B' to 'Z' do begin - t[i] += t[chr(ord(i)-1)]; - end; - - for j := 1 to length(s) do begin - t[Upcase(s[j])] -= 1; - k[t[Upcase(s[j])]] := s[j]; - end; - s := k; -end; - -procedure afficher(t : string; n : Integer); -var - i : Integer; -begin - for i:=1 to n do begin - Write(t[i], ' '); - end; - Writeln; -end; - -BEGIN - s := 'BCDADDALL'; - CountSort(s); - Writeln(s); -END. - diff --git a/sample/pascal-master/school/decomp.txt b/sample/pascal-master/school/decomp.txt deleted file mode 100644 index fcc9f9b9..00000000 --- a/sample/pascal-master/school/decomp.txt +++ /dev/null @@ -1,100 +0,0 @@ -2 100 -2=2 -3=3 -4=2.2 -5=5 -6=2.3 -7=7 -8=2.2.2 -9=3.3 -10=2.5 -11=11 -12=2.2.3 -13=13 -14=2.7 -15=3.5 -16=2.2.2.2 -17=17 -18=2.3.3 -19=19 -20=2.2.5 -21=3.7 -22=2.11 -23=23 -24=2.2.2.3 -25=5.5 -26=2.13 -27=3.3.3 -28=2.2.7 -29=29 -30=2.3.5 -31=31 -32=2.2.2.2.2 -33=3.11 -34=2.17 -35=5.7 -36=2.2.3.3 -37=37 -38=2.19 -39=3.13 -40=2.2.2.5 -41=41 -42=2.3.7 -43=43 -44=2.2.11 -45=3.3.5 -46=2.23 -47=47 -48=2.2.2.2.3 -49=7.7 -50=2.5.5 -51=3.17 -52=2.2.13 -53=53 -54=2.3.3.3 -55=5.11 -56=2.2.2.7 -57=3.19 -58=2.29 -59=59 -60=2.2.3.5 -61=61 -62=2.31 -63=3.3.7 -64=2.2.2.2.2.2 -65=5.13 -66=2.3.11 -67=67 -68=2.2.17 -69=3.23 -70=2.5.7 -71=71 -72=2.2.2.3.3 -73=73 -74=2.37 -75=3.5.5 -76=2.2.19 -77=7.11 -78=2.3.13 -79=79 -80=2.2.2.2.5 -81=3.3.3.3 -82=2.41 -83=83 -84=2.2.3.7 -85=5.17 -86=2.43 -87=3.29 -88=2.2.2.11 -89=89 -90=2.3.3.5 -91=7.13 -92=2.2.23 -93=3.31 -94=2.47 -95=5.19 -96=2.2.2.2.2.3 -97=97 -98=2.7.7 -99=3.3.11 -100=2.2.5.5 diff --git a/sample/pascal-master/school/devoir_pratique_2014 b/sample/pascal-master/school/devoir_pratique_2014 deleted file mode 100644 index 24dfa6c8..00000000 Binary files a/sample/pascal-master/school/devoir_pratique_2014 and /dev/null differ diff --git a/sample/pascal-master/school/devoir_pratique_2014.pas b/sample/pascal-master/school/devoir_pratique_2014.pas deleted file mode 100644 index ede5c24a..00000000 --- a/sample/pascal-master/school/devoir_pratique_2014.pas +++ /dev/null @@ -1,120 +0,0 @@ -type - mat = array [1..20, 1..20] of Byte; - tab = array [1..25] of Byte; -var - f : text; - m : mat; - n : Byte; - - function premier(n : Integer):Boolean; - var - verif : Boolean; - i : Integer; - begin - verif := True; - for i:=2 to (n div 2) do begin - if (n mod i = 0) then begin - verif := False; - end; - end; - - premier := verif; - end; -procedure remplir(var m : mat; var n: byte); - -var - t :tab; - c, i, j : Integer; -begin - c:= 1; - readln(n); - for i:=2 to 99 do begin - if premier(i) then begin - t[c] := i; - c := c+1; - end; - end; - for i := 1 to n do begin - for j := 1 to n do begin - m[i, j]:= t[random(25)+1]; - end; - end; -end; - -procedure affic(m : mat; n : byte); -var - i, j : Byte; -begin - for i := 1 to n do begin - for j := 1 to n do begin - write(m[i, j ], ' ') - end; - writeln; - end; - -end; - -procedure Trait(n : Integer; m : mat; var f : text); - procedure ecrireln(var f : text; k : Integer); - var - j : Integer; - begin - write(f, 'L', k, '*'); - for j:=1 to n do begin - write(f, m[k, j] ); - if (j<>n) then write(f, '-'); - end; - writeln(f); - end; - procedure ecrirecol(var f : text; k : Integer); - var - j : Integer; - begin - write(f, 'C', k, '*'); - for j:=1 to n do begin - write(f, m[j, k]); - if (j<>n) then write(f, '-'); - end; - writeln(f); - end; - var - i, c : Integer; -begin - rewrite(f) ; - for i := 1 to n do begin - c := 1; - {ordre croissant} - while (c=m[i, c+1]) do - c := c+1; - if (c=n) then begin - ecrireln(f, i); - end; - c:= 1; - while (c=m[c+1, i]) do - c := c+1; - if (c=n) then begin - ecrirecol(f, i); - end; - c := 1; - while (c '); - readln(n); - until n in [2..10]; - randomize; - for i:=1 to n do - for j:=1 to n do - m[i, j] := random(10); -end; - -procedure diago(var d1, d2 : byte; m : mat; n : byte); -var - i, j : byte; -begin - d1 := 0; - d2 := 0; - for i:=1 to n do - for j:=1 to n do - if j=i then d1 := d1 + m[i, j] - else if j=n-i+1 then d2 := d2+m[i, j]; -end; - -procedure affichage(m : mat; n : byte); -var - i, j : byte; -begin - for i:=1 to n do begin - for j:=1 to n do - write(m[i, j] ,' '); - writeln; - end; - - for i:=1 to n do begin - for j:=1 to n do begin - if (j=i) or (j=n-i+1) then write(m[i, j]); - write(' '); - end; - writeln; - end; -end; - -BEGIN - saisie(n, m); - affichage(m, n); - diago(d1, d2, m, n); - writeln('Diagonal 1 -> ', d1); - writeln('Diagonal 2 -> ', d2); -END. diff --git a/sample/pascal-master/school/distance b/sample/pascal-master/school/distance deleted file mode 100644 index 2fe86799..00000000 Binary files a/sample/pascal-master/school/distance and /dev/null differ diff --git a/sample/pascal-master/school/distance.pas b/sample/pascal-master/school/distance.pas deleted file mode 100644 index d3653771..00000000 --- a/sample/pascal-master/school/distance.pas +++ /dev/null @@ -1,89 +0,0 @@ - -program Distances; -Uses crt; - -type - tab = array ['A'..'J'] of array ['x'.. 'y'] of Integer; - mat = array ['A'..'J'] of array ['A'..'J'] of Real; -var - t : tab; - n : Byte; - m : mat; - Point : Char; -procedure Saisie(var t : tab; - var n : byte); -var - j, i : char; -begin - repeat - Writeln('N ? '); - readln(n); - until (n in [3..10]); - - for i:='A' to chr(64+n) do begin - for j:='x' to 'y' do begin - writeln(j, ' de ', i, ' ? '); - readln(t[i][j]); - end; - end; -end; - -procedure Traitement(t :tab; n : Byte; var m : mat); - function Pow2(x : Integer) : Real; - begin - Pow2 := x*x; - end; -var - i, j : char; - dis : Real; -begin - for i:='A' to chr(64+n) do begin - for j:='A' to i do begin - if (j=i) then m[i][j] := 0 - else begin - dis := sqrt(Pow2(t[i]['x'] - t[j]['x']) + Pow2(t[i]['y']- - t[j]['y'])); - m[i][j] := dis; - m[j][i] := dis; - end; - end; - end; -end; - -procedure Affichage( m : mat; n : byte ); -var - i, j : char; -begin - for i:='A' to chr(64+n) do begin - for j:='A' to chr(64+n) do begin - Write(m[i][j]:0:1, ' '); - end; - Writeln; - end; -end; - -function Chercher( n : byte; m : mat; P : char ): Char; -var - PremierVue : char; - Distance : Real; - i : char; -begin - PremierVue := 'A'; - Distance := m[P]['A']; - for i:='B' to chr(64+n) do begin - if (i <> P) and (m[P][i] 0) do begin - s := '0' +s; - end; - ch := ''; - facteur := 1; - somme := 0; - for i := 1 to length(s) do begin - ch := ch + s[i] ; - if (length(ch)=4) then begin - Val(ch, x, e); - somme := somme + (facteur * x) ; - facteur := -facteur; - ch := ''; - end; - end; - som := somme; - Trait := somme mod 137 = 0; -end; - -BEGIN - if Trait('2510792736157732104', som) then begin - Writeln('la somme est ', som, ' est divisble par 137'); - end - else Writeln('la somme est ', som, ' n''est pas divisible 137'); -END. diff --git a/sample/pascal-master/school/ft.txt b/sample/pascal-master/school/ft.txt deleted file mode 100644 index 107292a4..00000000 --- a/sample/pascal-master/school/ft.txt +++ /dev/null @@ -1,2 +0,0 @@ -L1*43-47-61 -C2*47-53-79 diff --git a/sample/pascal-master/school/fusion_fichiers b/sample/pascal-master/school/fusion_fichiers deleted file mode 100644 index d7fdd7d2..00000000 Binary files a/sample/pascal-master/school/fusion_fichiers and /dev/null differ diff --git a/sample/pascal-master/school/fusion_fichiers.pas b/sample/pascal-master/school/fusion_fichiers.pas deleted file mode 100644 index c830052f..00000000 --- a/sample/pascal-master/school/fusion_fichiers.pas +++ /dev/null @@ -1,60 +0,0 @@ -type - fi = file of Integer; -var - f1, f2, f3 : fi; - e : Integer; -procedure Fusion(var f1, f2, f3 : fi); -var - e1, e2 : Integer; -begin - reset(f1); - reset(f2); - rewrite(f3); - while (not(EOF(f1)) and not(EOF(f2))) do begin - read(f1, e1); - read(f2, e2); - if (e1=2) then begin - d := n div 2; - g := n -d; - for i:=1 to d do begin - l[i] := t[i]; - end; - for i:=1 to g do begin - m[i] := t[d+i]; - end; - - tri(l, d); - tri(m, g); - fusion(l, m, d, g, t); - end; -end; - -procedure afficher(t : tab; n : Integer); -var - i : Integer; -begin - for i:=1 to n do begin - Write(t[i], ' '); - end; - Writeln; -end; - -BEGIN - saisie(t, n); - tri(t, n); - afficher(t, n); -END. - diff --git a/sample/pascal-master/school/trirapide b/sample/pascal-master/school/trirapide deleted file mode 100644 index 1f4c0636..00000000 Binary files a/sample/pascal-master/school/trirapide and /dev/null differ diff --git a/sample/pascal-master/school/trirapide.pas b/sample/pascal-master/school/trirapide.pas deleted file mode 100644 index c6ed711b..00000000 --- a/sample/pascal-master/school/trirapide.pas +++ /dev/null @@ -1,72 +0,0 @@ - -program triRapide; -Uses crt; -type - tab = array [1..10] of Integer; -var - t : tab; - n : Word; -procedure Permuter(var a, b : Integer); -var - tmp : Integer; -begin - tmp := a; - a := b; - b := tmp ; -end; - -function Partioner(var t : tab; - debut, fin : Word): Word; -var - Index : Word; - Pivot : Integer; - i : Word; -begin - Index := debut; - Pivot := t[fin]; - for i :=debut to fin-1 do begin - if (t[i]<=Pivot) then begin - Permuter(t[i], t[index]); - Inc(Index); - end; - end; - Permuter(t[Index], t[fin]); - Partioner := Index; -end; - -procedure saisie(var t : tab;var n : Word); -var - i : Integer; -begin - readln(n); - for i := 1 to n do - begin - readln(t[i]); - end; -end; -procedure Tri(var t : tab; debut, fin : Word); -var - Index : Word; -begin - if (fin>debut) then begin - Index := Partioner(t, debut, fin); - Tri(t, debut, Index-1); - Tri(t, Index+1, fin); - end; -end; - -procedure afficher(t : tab; n : Integer); -var - i : Integer; -begin - for i:=1 to n do begin - Write(t[i], ' '); - end; - Writeln; -end; - -BEGIN - saisie(t, n ) ; - Tri(t, 1, n); - afficher(t, n); -END. diff --git a/sample/pascal-master/school/tris b/sample/pascal-master/school/tris deleted file mode 100644 index 62ecb32b..00000000 Binary files a/sample/pascal-master/school/tris and /dev/null differ diff --git a/sample/pascal-master/school/tris.pas b/sample/pascal-master/school/tris.pas deleted file mode 100644 index 54952c09..00000000 --- a/sample/pascal-master/school/tris.pas +++ /dev/null @@ -1,98 +0,0 @@ -program tris; -Uses crt; -type - tab = array of Integer; -var - n : Integer; - t : tab; - -procedure Saisie(var t : tab; var n : Integer); -var - i : Integer; -begin - readln(n); - SetLength(t, n); - for i := 0 to n-1 do begin - t[i] := random(400); - end; -end; - -procedure TriFusion(var t : tab; debut, fin : Integer); - - procedure Fusion(k, m : tab; var t : tab; n, c : Integer); - var - i, j, l : Integer; - begin - j := 1; - i := 1; - l :=1; - while (j<=n) and (i<=c) do begin - if (k[j]0) then begin - milieu := (fin + debut) div 2; - SetLength(k, milieu); - for i := debut to milieu do begin - k[i] := t[i]; - end; - SetLength(m, fin-milieu); - for i := milieu to fin do begin - m[i-milieu] := t[i]; - end; - TriFusion(K, debut, milieu-1); - TriFusion(m, debut, fin-milieu); - Fusion(K, M, T, 0, fin-milieu); - end; -end; - -procedure TriRapide(var t: tab; d, f: Integer); -begin - if (n>0) then begin - Position := Trier(t, d, f); - end; -end; - -procedure affic(t : tab; n : Integer); -var - i : Integer; -begin - for i := 1 to n do begin - write(t[i], ' ') - end; - writeln; -end; - -BEGIN - clRscr; - Saisie(t, n) ; - affic(t, n); - TriFusion(t, 0, n-1); - affic(t, n); -END. - diff --git a/sample/pascal-master/smart.pas b/sample/pascal-master/smart.pas deleted file mode 100644 index 949f86cf..00000000 --- a/sample/pascal-master/smart.pas +++ /dev/null @@ -1,58 +0,0 @@ -program test; -(* niveau difficile (intellignet) pour le jeu Tic-Tac-Toe *) -type - tab = array [1..9] of string; - -const - t : tab = ('1', '' , '0', - '' , '1', '1', - '1', '', '' - ); - -function difficile(t : tab) : byte; -var - st : byte; - -function com(c1, c2, c3 : string; n1, n2, n3 : byte; var foo : byte) : boolean; -begin - if c1 = c2 then - begin - foo := n3; - com := True; - end - else if c1 = c3 then - begin - foo := n2; - com := True; - end - else if c2 = c3 then - begin - foo := n1; - com := True; - end - else - com := False; -end; - -begin - if com(t[1], t[2], t[3], 1, 2, 3, st) or com(t[4], t[5], t[6], 4, 5, 6, st) or com(t[7], t[8], t[9], 7, 8, 9, st) - or com(t[1], t[4], t[7], 1, 4, 7, st) or com(t[2], t[5], t[8], 2, 5, 8, st) or com(t[3], t[6], t[9], 3, 6, 9, st) - or com(t[1], t[5], t[9], 1, 5, 9, st) or com(t[3], t[5], t[7], 3, 5, 7, st) then - begin - difficile := st; - //writeln(st); - end - else - begin - randomize; - difficile := random(9) + 1; - end; -end; - -BEGIN - writeln(difficile(t)); -END. -fggg - - - diff --git a/sample/pascal-master/snake b/sample/pascal-master/snake deleted file mode 100644 index 28d830ba..00000000 Binary files a/sample/pascal-master/snake and /dev/null differ diff --git a/sample/pascal-master/snake.pas b/sample/pascal-master/snake.pas deleted file mode 100644 index cfac5894..00000000 --- a/sample/pascal-master/snake.pas +++ /dev/null @@ -1,182 +0,0 @@ -(* Simple Snake game implemantation in Pascal - * using ncurses; written be Mohamed Aziz Knani - * Email : medazizknani@gmail.com - * Sorry for the spaghetti code :v - *) -program thePSnake; -{$H+} -uses ncurses; -type - Apple = record - Eaten : Boolean; - Shape : char; - Posi : array [1..2] of integer; - end; - Snake = record - Length : integer; - Shape : char; - Dead : boolean; - Dir : char; - HeadPos, BackPos : array [1..2] of integer; - end; - Board = array [2..25, 2..80] of char; -var - score, game : PWindow; - max_y, max_x : integer; { max screen size } - new_y, new_x : integer; { new screen size } - rand_y, rand_x : integer; - PApple : Apple; - PSnake : Snake; - scr, ang, rk, i, j : integer; - dir : char; - PBoard : Board; - -procedure drawBox(win : PWindow); (* it is PWindow in pascal not Window like in C and - C++*) -var - x, y, i : integer; -begin - getmaxyx(win, y, x); - mvwprintw(win, 0, 0, '+'); - mvwprintw(win, y - 1, 0, '+'); - mvwprintw(win, 0, x - 1, '+'); - mvwprintw(win, y - 1, x - 1, '+'); - for i:=1 to y - 2 do begin - mvwprintw(win, i, 0, '|'); - mvwprintw(win, i, x - 1, '|'); - end; - for i:= 1 to (x - 2) do begin - mvwprintw(win, 0, i, '-'); - mvwprintw(win, y - 1, i, '-'); - end; -end; - -procedure generateApple(max_y, max_x : integer; var rand_y, rand_x : integer); -begin - randomize; - rand_y := random(max_y-4)+2; - rand_x := random(max_x-3)+2; - mvwprintw(game, rand_y, rand_x, 'o'); -end; - -procedure movingSnake(var PSnake : Snake;Dir : char; var PBoard : Board); -var - tmp_y, tmp_x : integer; -begin - { Choice part } - if (Dir <> PSnake.Dir) and not((((PSnake.Dir = 'L') and (Dir = 'R')) - or ((PSnake.Dir = 'R') and (Dir = 'L' ))) - or (((PSnake.Dir = 'U') and (Dir = 'D')) - or (PSnake.Dir = 'D') and (Dir = 'U'))) then begin - if (Dir = 'U') then Dec(PSnake.HeadPos[1]) - else if (Dir = 'D') then Inc(PSnake.HeadPos[1]) - else if (Dir = 'R') then Inc(PSnake.HeadPos[2]) - else Dec(Psnake.HeadPos[2]); - PSnake.Dir := Dir; - end; - { moving part } - if (PSnake.Dir = 'R') then Inc(PSnake.HeadPos[2]) - else if (PSnake.Dir = 'L') then Dec(PSnake.HeadPos[2]) - else if (PSnake.Dir = 'U') then Dec(PSnake.HeadPos[1]) - else Inc(PSnake.HeadPos[1]); - tmp_y := PSnake.HeadPos[1]; tmp_x := PSnake.HeadPos[2]; - { I Will do the printing in the Main function } - PBoard[tmp_y][tmp_x] := 'S'; -end; - -procedure checkCollision(PSnake : Snake; var PApple : Apple); -begin - if (PSnake.HeadPos[1] = PApple.Posi[1]) - and (PSnake.HeadPos[2] = PApple.Posi[2]) then - PApple.Eaten := True - else PApple.Eaten := False; -end; - -function IntToStr (I : Longint) : String; -var - s : string; -begin - Str(I,S); - IntToStr:=s; -end; - -BEGIN - (* initialisations *) - initscr(); - noecho(); - curs_set(0); - (* let's disable this for a while *) - nodelay(stdscr, True); - (* let's make two windows *) - getmaxyx(stdscr, max_y, max_x); - game := newwin(max_y-3, max_x, 0, 0); - score := newwin(3, max_x, max_y-3, 0); - (* we should refresh after we print *) - drawBox(game); - drawBox(score); - { Objects initialisations } - PApple.Eaten := True; - PApple.Shape := 'o'; - PSnake.Shape := 'O'; - PSnake.Length := 5; - PSnake.Dead := False; - scr := -1; - PSnake.HeadPos[1] := 5; - PSnake.HeadPos[2] := 20; - PSnake.Dir := 'D'; - for i:=2 to max_y-5 do - for j:=2 to max_x do - PBoard[i][j] := 'E'; { E means empty } - nodelay(game, True); - (* Game logic here *) - while True do begin - (* dynamic resizing *) - getmaxyx(stdscr, new_y, new_x); - if (new_y <> max_y) or (new_x <> max_x) then begin - max_y:=new_y; max_x:=new_x; - game := newwin(max_y-3, max_x, 0, 0); - score := newwin(3, max_x, max_y-3, 0); - wclear(game); - wclear(score); - drawBox(game); - drawBox(score); - end; - rk := wgetch(game); - case rk of - 67 : Dir := 'R'; {Right} - 68 : Dir := 'L'; {Left} - 65 : Dir := 'U'; {UP} - 66 : Dir := 'D'; {Down} - end; - movingSnake(PSnake, Dir, PBoard); - checkCollision(PSnake, PApple); - if (PApple.Eaten) or (scr = -1) then begin - {mvwdelch(game, rand_y, rand_x);} - mvwprintw(game, rand_y, rand_x, ' '); - PBoard[rand_y][rand_x] := 'E'; - generateApple(max_y, max_x, rand_y, rand_x); - PBoard[rand_y][rand_x] := 'A'; { A means apple } - Inc(scr); - Inc(PSnake.Length); - end; - { Printing Part; Printing the board to the screen - for i:=2 to max_y-6 do - for j:=2 to max_x do - begin - in this way it will clean itself no need for window clear - if (PBoard[i][j] = 'S') then begin - mvwprintw(game, j, i, 'O'); - PBoard[i][j] := 'E'; - end - else if (PBoard[i][j] = 'E') then mvwprintw(game, j, i, ' '); - //napms(20); - end;} - { this cleans behind the Snake } - { Displaying score } - mvwprintw(game, PSnake.HeadPos[1], PSnake.HeadPos[2], ' '); - mvwprintw(score, 1, 1, PChar(concat(IntToStr(scr), ' '))); { the argument must be passed as a PChar } - wrefresh(game); - wrefresh(score); - end; - endwin(); -END. diff --git a/sample/pascal-master/spaceShip/11329723_1598396567089677_85252936_n.jpg b/sample/pascal-master/spaceShip/11329723_1598396567089677_85252936_n.jpg deleted file mode 100644 index 4c8ce7e3..00000000 Binary files a/sample/pascal-master/spaceShip/11329723_1598396567089677_85252936_n.jpg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/300px-Asteroid.png b/sample/pascal-master/spaceShip/300px-Asteroid.png deleted file mode 100644 index ea96fd97..00000000 Binary files a/sample/pascal-master/spaceShip/300px-Asteroid.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/58544-b6e59e60a4b1c193e8ad8e1ae91eedca.jpg b/sample/pascal-master/spaceShip/58544-b6e59e60a4b1c193e8ad8e1ae91eedca.jpg deleted file mode 100644 index a3388738..00000000 Binary files a/sample/pascal-master/spaceShip/58544-b6e59e60a4b1c193e8ad8e1ae91eedca.jpg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/7 b/sample/pascal-master/spaceShip/7 deleted file mode 100644 index 61269041..00000000 --- a/sample/pascal-master/spaceShip/7 +++ /dev/null @@ -1,118 +0,0 @@ - -uses Allegro5, Al5image; - -Const - FPS = 60; - frame_delay = 10; - screen_h = 800; - screen_w = 600; -type - projectiles = (Bullet, Rocket); - bu = array [1..5] of record - ID : projectiles; - live : Boolean; - x, y, speed : integer; - end; - -Var - Display : ALLEGRO_DISPLAYptr; - redfighter, - SpaceWall : ALLEGRO_BITMAPptr; - cond : boolean; - timer : ALLEGRO_TIMERptr; - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - frame_count, - curr_frame, i : byte; - deg : integer; - rad, y, x, s : real; - Up, Down, - redraw, Turbo : Boolean; - Bullets : bu; - pro : bu; - -procedure Initprojectiles(var Bullets : bu); -begin - for i:=1 to 5 do begin - Bullets.ID := Bullet; - Bullets.live := False; - Bullets.speed := 1; - end; -end; - -procedure Fireprojectile(var ) - -BEGIN - s := 1; - x := 200; - y := 100; - curr_frame := 1; - frame_count := 0; - x := 100; - cond := True; - al_init(); - al_init_image_addon(); - al_install_keyboard(); - Initprojectiles(Bullets); - Display := al_create_display(screen_h, screen_w); - timer := al_create_timer(1.0/FPS); - event_queue := al_create_event_queue(); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - al_register_event_source(event_queue, al_get_timer_event_source(timer)); - al_register_event_source(event_queue, al_get_keyboard_event_source()); - al_start_timer(timer); - - - redfighter := al_load_bitmap('redfighter.png'); - SpaceWall := al_load_bitmap('galaxy.jpg'); - while cond do begin - al_wait_for_event(event_queue, ev); - - if (ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE) then cond := False - else if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then - case ev.keyboard.keycode of - AlLEGRO_KEY_UP : Up := True; - ALLEGRO_KEY_DOWN : Down := True; - ALLEGRO_KEY_SPACE : Turbo := True; - end - else if (ev._type = ALLEGRO_EVENT_KEY_UP) then - case ev.keyboard.keycode of - AlLEGRO_KEY_UP : Up := False; - ALLEGRO_KEY_DOWN : Down := False; - ALLEGRO_KEY_SPACE : Turbo := False; - end - else if (ev._type = ALLEGRO_EVENT_TIMER) then begin - if Turbo then s += 0.1 - else if s > 0 then s -= 0.1; - if Up then deg -= 3 - else if Down then deg += 3; - rad := deg * pi /180; - - x += trunc(cos(rad)*s); - y += trunc(sin(rad)*s); - {object redirection} - if (screen_h+68 < x) then x := -68 - else if (-76 > y) then y := screen_w+76 - else if (screen_w+76 < y) then y := -76 - else if (-68 > x) then x := screen_h+68; - redraw := True; - if redraw and al_is_event_queue_empty(event_queue) then begin - al_draw_bitmap(SpaceWall, 0, 0, 0); - {al_clear_to_color(al_map_rgb(0, 12, 11));} - { Drawing the ship :3 } - al_draw_rotated_bitmap(redfighter, 68 / 2, 76 / 2, x , y, rad , 0); - - al_flip_display(); - redraw := False; - end; - end; - - end; - al_destroy_bitmap(redfighter); - al_destroy_event_queue(event_queue); - al_destroy_timer(timer); - al_destroy_display(Display); -END. - - - diff --git a/sample/pascal-master/spaceShip/Exp_type_A.png b/sample/pascal-master/spaceShip/Exp_type_A.png deleted file mode 100644 index 7ef38550..00000000 Binary files a/sample/pascal-master/spaceShip/Exp_type_A.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/Makefile b/sample/pascal-master/spaceShip/Makefile deleted file mode 100644 index f0345fa7..00000000 --- a/sample/pascal-master/spaceShip/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -all: - fpc -Fuallegro-pas.5.0/lib spaceShip.pas -debug: - fpc -gl -Fuallegro-pas.5.0/lib spaceShip.pas -run: - ./spaceShip diff --git a/sample/pascal-master/spaceShip/Shadow_projectile_special.gif b/sample/pascal-master/spaceShip/Shadow_projectile_special.gif deleted file mode 100644 index e9133be4..00000000 Binary files a/sample/pascal-master/spaceShip/Shadow_projectile_special.gif and /dev/null differ diff --git a/sample/pascal-master/spaceShip/Space Dandy (Outro) 8-Bit Remix-qjDOIuWjH30.m4a b/sample/pascal-master/spaceShip/Space Dandy (Outro) 8-Bit Remix-qjDOIuWjH30.m4a deleted file mode 100644 index 24e2a118..00000000 Binary files a/sample/pascal-master/spaceShip/Space Dandy (Outro) 8-Bit Remix-qjDOIuWjH30.m4a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/a.png b/sample/pascal-master/spaceShip/a.png deleted file mode 100644 index 8a3b5d09..00000000 Binary files a/sample/pascal-master/spaceShip/a.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/AUTHORS b/sample/pascal-master/spaceShip/allegro-pas.5.0/AUTHORS deleted file mode 100644 index 9e55f846..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/AUTHORS +++ /dev/null @@ -1 +0,0 @@ - Elias (www.allegro.cc) helped testing the Delphi version. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/LICENSE b/sample/pascal-master/spaceShip/allegro-pas.5.0/LICENSE deleted file mode 100644 index 3786a8d0..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -Copyright (c) 2013 Guillermo Martínez J. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/README b/sample/pascal-master/spaceShip/allegro-pas.5.0/README deleted file mode 100644 index d5dbe102..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/README +++ /dev/null @@ -1,148 +0,0 @@ - ______ ___ ___ -/\ _ \ /\_ \ /\_ \ -\ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ __ ___ ____ - \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ /'__`\ /\__`\ /'___/ - \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \__/\ \L\ \\/ __ \/\____`\ - \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/\_\ \ __//\____/\/\____/ - \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/\/_/\ \ \/ \/___/ \/___/ - /\____/ \ \_\ - Version 5.0.alpha 1 \/___/ \/_/ - - A wrapper to use the Allegro library with Pascal compilers - by Ñuño Martínez, April 24, 2013. - - - -======== -Contents -======== - - - Introduction - - License - - Installation - - Documentation - - Contact info - - - -============ -Introduction -============ - - Allegro.pas is a wrapper to allow Pascal compilers (such as Free Pascal) - to use the Allegro library. - - Note that Allegro 5 is wholly *incompatible* with Allegro 4 and earlier - versions, and so is Allegro.pas, but both may be installed at the same time - without conflicts. - - This is a WIP (alpha) version of the Allegro.pas 5 version. It is released - to show what's done and to allow developers to test it and give feed back. - DON'T USE IT FOR FINAL USE, in this case use Allegro.pas 4.4 version, which - is the latest stable version released. Please go to the Allegro.pas' project - site at sourceforge for more information. - - Current version was tested only on GNU/Linux + Free Pascal. An earlier SVN - version was tested while development by a volunteer in Windows + Delphi but I - can't grant it will work. Other operanting systems and compilers weren't - tested. - - The goal is to make Allegro.pas 5 compatible with any operating system - supported by Allegro, which are Windows, Linux, MacOS and iOS. AFAIK all - these OS have Pascal compilers. - - As this is a WIP alpha version, you should remember that at the moment not - all functionality are implemented. - -Implemented ------------ - - + Event manager, including but not limited to keyboard, mouse, timer and - display. - - + OpenGL support (except extensions). - - + Software bitmaps. - - + Text drawing. - - + Transformations. - -Partially implemented or need more testing ------------------------------------------- - - * Primitive drawing. - - * Audio samples and streams. - - * Native dialogs. - - * ttf fonts. - - -Unimplemented -------------- - - - OpenGL extensions. - - - kcm audio. - - - Custom memory management. - - - Phys file system. - - - Demonstration game. - - You can read more about this at the "docs/internal" subdirectory. - - -======= -License -======= - - Allegro.pas is released under zlib/png license. Read it in file LICENSE. - - - -============ -Installation -============ - - First you must install Allegro itself. Current Allegro.pas version is - compatible with version 5.0.x only so DON'T install verision 5.1.x. Visit - Allegro's project website at http://alleg.sf.net/ to download it. The - package includes installation instructions. - - Then you need a Pascal compiler. At the moment only Free Pascal and Delphi - were tested but may be other compilers (such as GNU/Pascal) can be used too. - - Each combination of compiler and operating system may need different - configuration so if it doesn't compile open file "lib/allegro.cfg" and modify - it. REMEMBER what do you change and let me know it so I can add it in future - releases. - - - -============= -Documentation -============= - - At the moment the public documentation isn't complete. Since symbols have - same name than the C version you can use the original Allegro documentation. - - BTW I've put some information at the docs/internal subdirectory. Read it - specially if you're planning to write or hack your own test programs. - - - -============ -Contact info -============ - - You can contact me at http://allegro-pas.sourceforge.net. There - are forums and a mailing-list you can use. Also I visit quite often the - next forums: - - Pascal Game Development - http://www.pascalgamedevelopment.com/ - Club Delphi - http://www.clubdelphi.com/ - Hispalazarus - http://hispalazarus.forogratis.es/ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/TODO b/sample/pascal-master/spaceShip/allegro-pas.5.0/TODO deleted file mode 100644 index b2ffbf29..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/TODO +++ /dev/null @@ -1,16 +0,0 @@ -In no special order - - * Add to documentation a note about to define symbol "DEBUGMODE" if using - "-g". - - * There are some "enum" types (sets). Be sure that they have the correct - sice in bits. Read FPC and Delphi help. - - * Documentation isn't written. - May be I should find another documentation tool as pasdoc is "dirty". - Else use pasdoc. - - * Document COLOR issue (can't use functions "_map_" as parameters in - Windows (?)). - - * MUST normalize types (VAR vs. POINTER, OUT vs. VAR, STRING vs. PCHAR ...). diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/clean.sh b/sample/pascal-master/spaceShip/allegro-pas.5.0/clean.sh deleted file mode 100644 index 2b3849c7..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/clean.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -rm obj/*.o obj/*.a obj/*.ppu diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/README b/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/README deleted file mode 100644 index 9bddd754..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/README +++ /dev/null @@ -1,4 +0,0 @@ - - Read the "style.txt" file to know the coding style to use. - - Read the "c2pas.txt" file to know how to "translate" from C to Pascal. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/c2pas.txt b/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/c2pas.txt deleted file mode 100644 index e90e3f94..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/c2pas.txt +++ /dev/null @@ -1,149 +0,0 @@ - Convert C to Pascal - =================== - - This is a brief explanation about how to convert C code to Pascal. Note that - this document is to help to write the Allegro.pas wrapper library. - - You should read file "style.txt" too. - - - -Content -------- - - * Allegro's API description - * Data types - * Enumerations - * Parameters and return values - * NOTES - - - -Allegro's API description -------------------------- - - Allegro aims to define an API that is the same in any platform supported, so - it's easer to port programs from one to another. Since each platform has a - different calling conventions it defines some "macros" to help to declare - functions[1], data types and variables. - - "AL_FUNC (type, name, args)" defines a procedure (if type is "void") or - function. Note that "args" are a list of "type name" separated by comma. - - For example: - - AL_FUNC (void, al_set_new_bitmap_format, (int format)); - AL_FUNC (int, al_get_new_bitmap_format, (void)); - - becames - - PROCEDURE al_set_new_bitmap_format (format: LONGINT); CDECL; - FUNCTION al_get_new_bitmap_format: LONGINT; CDECL; - - The "CDECL" modifier tells the compiler that it's a C function. It's - necesary because C uses a different calling convention than Pascal. - - Most functions are in dll/so/dylib files so they're external. - - Some functions are "inline", and should be "INLINE" in Pascal too. Also - wrapper functions and procedures should bee "INLINE" too. - - - -Data types ----------- - - C data types aren't very different than Pascal ones, but we should be careful - to keep the same size to make them compatible. - - Free Pascal compiler activates some CPU exceptions to manage data - conversions. By default, C compilers don't activate these exceptions. That - results in some issues as discused in an Allegro.cc forum thread[2]. - - Pointers in C are marked by "*". "*char" are a pointer to char, but they - actually use it as ANSISTRINGS. I think it's better to use "PCHAR" and - create inlined wrappers for parameters and function returning. By the way - I've defined type AL_STRptr for that cases. - - C doesn't distiguish between array and pointers. Actually an array is a - pointer that points to a "non dynamic" memory space. - - "bool" is the bad guy here. It's a recent addition to the C language - (1999 IIRC) and not all compilers support it. Allegro's defines it as - "unsigned char" if compiler doesn't supports it. - - Enumerations are discussed in next section. - - Here you have a list of data types. First column are C types, second are - Pascal types. - - bool BYTEBOOL[3] - - char CHAR or SHORTINT (depending the use). - unsigned char BYTE - *char PCHAR or ANSISTRING - - int LONGINT - long int LONGINT or INT64 - unsigned int LONGWORD - unsigned long int LONGWORD or QWORD - - uint32_t LONGWORD - - float SINGLE - double DOUBLE - - - Anyway, unit al5base defines some types to make it easer. For example, C - type "int" is "AL_INT", "unsigned int" is "AL_UINT", etcetera. - - -Enumerations ------------- - - Enumerations are another "bad guy". In C There are almost no differences - between "enum" and "int". Actually, Allegro 5 doesn't use enums as function - parameter, it uses "int". I think we should use enumerations. - - Free Pascal and Delphi optimizes enumerations. Both have modifiers that - modifies that. AFAIK C enums are 4 bytes wide. - - - -Parameters and return values ----------------------------- - - In most functions parameters are pased "by value" with no modifications. - - In some cases they're passed as "const", so we must use the "CONST" modifier. - - C hasn't "VAR" nor "OUT" modifiers: it uses pointer for this. It looks like - FPC translates "VAR" to pointers, so I'm using VAR in some places. If Delphi - doesn't do it the same way or there are problems then we should use wrapper - procedures instead: - -INTERFACE - - PROCEDURE WrapperProcedure (VAR Variable: AL_UINT); INLINE; - -IMPLEMENTATION - - PROCEDURE _ActualFunction_ (ValuePtr: AL_UINTptr); CDECL; EXTERNAL ...; - - PROCEDURE WrapperProcedure (VAR Variable: AL_UINT); - BEGIN - _ActualFunction_ (@Variable); - END; - - - -NOTES ------ - - [1] In C there's no difference between "function" and "procedure"; both are - functions. The difference is that some functions doesn't returns any - value (they're of type "void"). - - [2] http://www.allegro.cc/forums/thread/602423 - - [3] Not sure but it seems to work. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/c2pas.txt.orig b/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/c2pas.txt.orig deleted file mode 100644 index 63ec832f..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/c2pas.txt.orig +++ /dev/null @@ -1,149 +0,0 @@ - Convert C to Pascal - =================== - - This is a brief explanation about how to convert C code to Pascal. Note that - this document is to help to write the Allegro.pas wrapper library. - - You should read file "style.txt" too. - - - -Content -------- - - * Allegro's API description - * Data types - * Enumerations - * Parameters and return values - * NOTES - - - -Allegro's API description -------------------------- - - Allegro aims to define an API that is the same in any platform supported, so - it's easer to port programs from one to another. Since each platform has a - different calling conventions it defines some "macros" to help to declare - functions[1], data types and variables. - - "AL_FUNC (type, name, args)" defines a procedure (if type is "void") or - function. Note that "args" are a list of "type name" separated by comma. - - For example: - - AL_FUNC (void, al_set_new_bitmap_format, (int format)); - AL_FUNC (int, al_get_new_bitmap_format, (void)); - - becames - - PROCEDURE al_set_new_bitmap_format (format: LONGINT); CDECL; - FUNCTION al_get_new_bitmap_format: LONGINT; CDECL; - - The "CDECL" modifier tells the compiler that it's a C function. It's - necesary because C uses a different calling convention than Pascal. - - Most functions are in dll/so/dylib files so they're external. - - Some functions are "inline", and should be "INLINE" in Pascal too. Also - wrapper functions and procedures should bee "INLINE" too. - - - -Data types ----------- - - C data types aren't very different than Pascal ones, but we should be careful - to keep the same size to make them compatible. - - Free Pascal compiler activates some CPU exceptions to manage data - conversions. By default, C compilers don't activate these exceptions. That - results in some issues as discused in an Allegro.cc forum thread[2]. - - Pointers in C are marked by "*". "*char" are a pointer to char, but they - actually use it as ANSISTRINGS. I think it's better to use "PCHAR" and - create inlined wrappers for parameters and function returning. By the way - I've defined type AL_STRptr for that cases. - - C doesn't distiguish between array and pointers. Actually an array is a - pointer that points to a "non dynamic" memory space. - - "bool" is the bad guy here. It's a recent addition to the C language - (1999 IIRC) and not all compilers supports it. Allegro's defines it as - "unsigned char" if compiler doesn't supports it. - - Enumerations are discussed in next section. - - Here you have a list of data types. First column are C types, second are - Pascal types. - - bool BYTEBOOL[3] - - char CHAR or SHORTINT (depending the use). - unsigned char BYTE - *char PCHAR or ANSISTRING - - int LONGINT - long int LONGINT or INT64 - unsigned int LONGWORD - unsigned long int LONGWORD or QWORD - - uint32_t LONGWORD - - float SINGLE - double DOUBLE - - - Anyway, unit al5base defines some types to make it easer. For example, C - type "int" is "AL_INT", "unsigned int" is "AL_UINT", etcetera. - - -Enumerations ------------- - - Enumerations are another "bad guy". In C There are almost no differences - between "enum" and "int". Actually, Allegro 5 doesn't use enums as function - parameter, it uses "int". I think we should use enumerations. - - Free Pascal and Delphi optimizes enumerations. Both have modifiers that - modifies that. AFAIK C enums are 4 bytes wide. - - - -Parameters and return values ----------------------------- - - In most functions parameters are pased "by value" with no modifications. - - In some cases they're passed as "const", so we must use the "CONST" modifier. - - C hasn't "VAR" nor "OUT" modifiers: it uses pointer for this. It looks like - FPC translates "VAR" to pointers, so I'm using VAR. If Delphi doesn't do it - the same way or there are problems then we should use wrapper procedures - instead: - -INTERFACE - - PROCEDURE WrapperProcedure (VAR Variable: AL_UINT); INLINE; - -IMPLEMENTATION - - PROCEDURE _ActualFunction_ (ValuePtr: AL_UINTptr); CDECL; EXTERNAL ...; - - PROCEDURE WrapperProcedure (VAR Variable: AL_UINT); - BEGIN - _ActualFunction_ (@Variable); - END; - - - -NOTES ------ - - [1] In C there's no difference between "function" and "procedure"; both are - functions. The difference is that some functions doesn't returns any - value (they're of type "void"). - - [2] http://www.allegro.cc/forums/thread/602423 - - [3] Not sure but it seems to work. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/style.txt b/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/style.txt deleted file mode 100644 index 8a2a6bca..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/docs/internal/style.txt +++ /dev/null @@ -1,157 +0,0 @@ - Coding Style - ============ - - Here you have some tips about how to write the sources. The idea is make the - code ease to read and maintain. - - - -Content -------- - - * Comments - * Comments - * Indentation - * Spaces - * Line length - - - -Comments --------- - - Sources must include comments. In most cases, these coments are copyed from - Allegro's documentation, but include also any useful information. - - The comments should be formatted as explained in pasdoc documentation, so - anybody can create a full documentation using it. - Visit http://pasdoc.sipsolutions.net/ for more information. - - Use (*...*) comments for important information and {...} for additional - documentation. Do not use nested comments because they're a common source of - problems and mistakes. Deactivate nested comments from your compiler options - to be sure. - - Do not use C++ style comments (//...) just because they're ugly. An exception - for C++ comments would be to temporally deactivate code. - - Deactivate code using comments only if you'll activate it in the future. Note - that I'll delete any commented code I find before to pack a release (except - algorithm descriptions, of course). - - - -Identifiers ------------ - - Public names and identifiers should be the same than the original Allegro API - ones. - - Keywords should be UPPERCASE. I know that modern IDEs (i.e. Delphi and - Lazarus) write them lowercase but I find sources are easer to read with - keywords written in uppercase even with syntax highlighting. - - Constants, enumerations and type names should be UPPERCASE too, using “_” - character to separate words. - - - -Indentation ------------ - - This is a complex issue, but it must be used. - - I use 2-spaces indentation, using a tab-character for 8 spaces. - - BEGIN and END keywords should be on the same column. Same with REPEAT and - UNTIL, CASE and END, etcetera. - - Comments should have one less indentation than the code if available. - -(* Good indentation example. *) - PROCEDURE Example (Parm: INTEGER); - BEGIN - IF Parm = Value THEN - DoSomething (Param) - ELSE BEGIN - DoElse (Param); - WHILE Param > 0 DO - BEGIN - DoOther (Param); - DEC (Param); - END; - END; - { Other more strict way. It shows also comment indentation. } - IF Parm = Value THEN - DoSomething (Param) - ELSE - BEGIN - DoElse (Param); - { This comments the loop. } - WHILE Param > 0 DO - BEGIN - DoOther (Param); - DEC (Param); - END; - END; - END; - - - -Spaces ------- - - Put spaces before a parenthesis open, after a comma and surrounding operators. - This will make things easer to read. - -{ Space example. } - Variable := Origin + SomeFunction (Value, 123 + (456 * Cnt)); -{ Compare with this. } - Variable:=Origin+SomeFunction(Value,123+(456*Cnt)); - - Use empty lines to separate logical blocks. Use 3 empty lines to separate - each RECORD, CLASS, PROCEDURE or FUNCTION with others so it's easy to find - where it starts and ends. So do not put more than one empty line to separate - code inside a BEGIN...END code block. - -(* This is a function to show how to use empty lines to separate - logic blocs. *) - FUNCTION Example: BOOLEAN; - BEGIN - Example := TRUE; - END; - - - -(* This procedure is preceded by 3 empty lines so it's easy to - find where the previous one finishes and where this starts. *) - PROCEDURE Other; - BEGIN - IF Something THEN - DoThis; - DoSometing; - - { The previous line separates a logic block. } - DoMore; - END; - - - -Line length ------------ - - Remember that horizontal scroll is evil and some editors (i. e. Vi) doesn't - allow it, so avoid it if possible. You can split long procedure calls or - conditionals or everything else. Use indentation to help reading. - -{ An example about how to split long lines. } - IF (AbnormallyLongVariableName <> A_VERY_LONG_CONSTANT_NAME) - AND (AbnormallyLongVariableName < OTHER_CONSTANT) - THEN - ThisProcedureHasALongName ( - AbnormallyLongVariableName, - AnObject.AnotherVeryLongNameForMethod ( - AgainAnObjectWithAVeryLongName.UsefulPropertyToUse - ), - LongNameForSomethingElse.ThatsEnough - ); diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/common.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/common.pas deleted file mode 100644 index 28a9619d..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/common.pas +++ /dev/null @@ -1,76 +0,0 @@ -UNIT Common; -(* Common stuff for examples. *) - -INTERfACE - -(* Exits program with error. *) - PROCEDURE AbortExample (CONST Message: STRING); - -(* Opens a log window. *) - PROCEDURE OpenLog; - -(* Prints a message on the log window. *) - PROCEDURE LogWrite (Str: STRING); - PROCEDURE LogWriteLn (Str: STRING); - -(* Closes the log window. *) - PROCEDURE CloseLog (WaitForUser: BOOLEAN); - -IMPLEMENTATION - - USES - Allegro5, al5nativedlg; - - VAR - TextLog: ALLEGRO_TEXTLOGptr; - -(* Exits program with error. *) - PROCEDURE AbortExample (CONST Message: STRING); - BEGIN - WriteLn (Message); - HALT (1); - END; - - - -(* Opens a log window. *) - PROCEDURE OpenLog; - BEGIN - TextLog := al_open_native_text_log ('Log', 0); - END; - - - -(* Prints a message on the log window. *) - PROCEDURE LogWrite (Str: STRING); - BEGIN - al_append_native_text_log (TextLog, Str); - END; - - PROCEDURE LogWriteLn (Str: STRING); - BEGIN - al_append_native_text_log (TextLog, Str + #10); - END; - - - -(* Closes the log window. *) - PROCEDURE CloseLog (WaitForUser: BOOLEAN); - VAR - Queue: ALLEGRO_EVENT_QUEUEptr; - Event: ALLEGRO_EVENT; - BEGIN - IF (TextLog <> NIL) AND WaitForUser THEN - BEGIN - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_native_text_log_event_source( - TextLog - )); - al_wait_for_event (Queue, Event); - al_destroy_event_queue (Queue); - END; - al_close_native_text_log (TextLog); - TextLog := NIL; - END; - -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/a4_font.tga b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/a4_font.tga deleted file mode 100644 index 4660c260..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/a4_font.tga and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/bkg.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/bkg.png deleted file mode 100644 index cdac4768..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/bkg.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/bmpfont.tga b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/bmpfont.tga deleted file mode 100644 index 4d8ae78d..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/bmpfont.tga and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/fixed_font.tga b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/fixed_font.tga deleted file mode 100644 index bc751239..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/fixed_font.tga and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_0.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_0.ogg deleted file mode 100644 index 387204bb..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_0.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_1.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_1.ogg deleted file mode 100644 index 4dcf8c06..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_1.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_2.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_2.ogg deleted file mode 100644 index b6fa2bbc..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_2.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_3.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_3.ogg deleted file mode 100644 index 02dbb204..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_3.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_4.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_4.ogg deleted file mode 100644 index ed9a0c10..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_4.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_5.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_5.ogg deleted file mode 100644 index 06d57a70..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_5.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_6.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_6.ogg deleted file mode 100644 index 81767ab1..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_6.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_7.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_7.ogg deleted file mode 100644 index 58ea769b..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_7.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_effect.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_effect.png deleted file mode 100644 index 23d2d593..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/air_effect.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/black_bead_opaque_A.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/black_bead_opaque_A.png deleted file mode 100644 index 72476cdb..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/black_bead_opaque_A.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/dropshadow.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/dropshadow.png deleted file mode 100644 index ea8a6aab..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/dropshadow.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth4.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth4.png deleted file mode 100644 index c76776bd..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth4.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_0.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_0.ogg deleted file mode 100644 index cb795c15..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_0.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_1.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_1.ogg deleted file mode 100644 index 20ea069f..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_1.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_2.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_2.ogg deleted file mode 100644 index 3b8b88c6..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_2.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_3.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_3.ogg deleted file mode 100644 index 51d93455..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_3.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_4.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_4.ogg deleted file mode 100644 index 176a82b9..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_4.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_5.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_5.ogg deleted file mode 100644 index ee640fb2..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_5.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_6.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_6.ogg deleted file mode 100644 index 62bffbf0..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_6.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_7.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_7.ogg deleted file mode 100644 index 858637b0..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/earth_7.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire.png deleted file mode 100644 index 63ad571c..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_0.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_0.ogg deleted file mode 100644 index d9f9e314..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_0.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_1.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_1.ogg deleted file mode 100644 index a5791d68..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_1.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_2.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_2.ogg deleted file mode 100644 index 7bee537d..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_2.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_3.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_3.ogg deleted file mode 100644 index adc748fc..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_3.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_4.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_4.ogg deleted file mode 100644 index 8442dd38..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_4.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_5.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_5.ogg deleted file mode 100644 index 752449f3..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_5.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_6.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_6.ogg deleted file mode 100644 index c59cfc44..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_6.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_7.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_7.ogg deleted file mode 100644 index 4fc346aa..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/fire_7.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/flame2.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/flame2.png deleted file mode 100644 index d78481b7..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/flame2.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/healthy_glow.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/healthy_glow.png deleted file mode 100644 index efee4a65..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/healthy_glow.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/main_flame2.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/main_flame2.png deleted file mode 100644 index e79ca015..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/main_flame2.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/overlay_pretty.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/overlay_pretty.png deleted file mode 100644 index f8b257cb..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/overlay_pretty.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/select.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/select.ogg deleted file mode 100644 index 444fae37..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/select.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water.png deleted file mode 100644 index 8bc6a080..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_0.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_0.ogg deleted file mode 100644 index 2913d51c..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_0.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_1.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_1.ogg deleted file mode 100644 index acccff4c..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_1.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_2.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_2.ogg deleted file mode 100644 index 0007bd31..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_2.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_3.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_3.ogg deleted file mode 100644 index ad1b0c2c..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_3.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_4.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_4.ogg deleted file mode 100644 index 8471058a..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_4.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_5.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_5.ogg deleted file mode 100644 index 5c29e9c3..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_5.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_6.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_6.ogg deleted file mode 100644 index fb40145c..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_6.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_7.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_7.ogg deleted file mode 100644 index dfcbe730..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_7.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_droplets.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_droplets.png deleted file mode 100644 index e5978746..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/water_droplets.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/wind3.png b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/wind3.png deleted file mode 100644 index 2104ab57..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/haiku/wind3.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/mysha.pcx b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/mysha.pcx deleted file mode 100644 index 1225b4cf..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/mysha.pcx and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/testing.ogg b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/testing.ogg deleted file mode 100644 index 2a2dc555..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/testing.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/texture.tga b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/texture.tga deleted file mode 100644 index f4e8358a..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/data/texture.tga and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_audio_simple.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_audio_simple.pas deleted file mode 100644 index 543100e5..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_audio_simple.pas +++ /dev/null @@ -1,100 +0,0 @@ -PROGRAM ex_audio_simple; -(* Example program for the Allegro library. - * - * Demonstrate 'simple' audio interface. - *) -USES - common, - Allegro5, al5audio, al5acodec; -CONST - RESERVED_SAMPLES = 16; - MAX_SAMPLE_DATA = 10; -VAR - SampleData: ARRAY [1..MAX_SAMPLE_DATA] OF ALLEGRO_SAMPLEptr; - Display: ALLEGRO_DISPLAYptr; - EventQueue: ALLEGRO_EVENT_QUEUEptr; - Event: ALLEGRO_EVENT; - Ndx: INTEGER; - FileName: STRING; - EndLoop: BOOLEAN; -BEGIN - IF Paramcount < 1 THEN - BEGIN - WriteLn ('Usage:'); - WriteLn (' ', ParamStr (0), ' {audio_files}'); - HALT (1); - END; - - IF NOT al_init THEN - AbortExample ('Could not init Allegro.'); - - al_install_keyboard; - - Display := al_create_display (640, 480); - IF Display = NIL THEN - AbortExample ('Could not create display'); - - EventQueue := al_create_event_queue; - al_register_event_source (EventQueue, al_get_keyboard_event_source); - al_register_event_source (EventQueue, al_get_display_event_source (Display)); - - al_init_acodec_addon; - IF NOT al_install_audio THEN - BEGIN - WriteLn ('Could not init sound!'); - HALT (1); - END; - IF NOT al_reserve_samples (RESERVED_SAMPLES) THEN - BEGIN - WriteLn ('Could not set up voice and mixer.'); - HALT (1); - END; - - FOR Ndx := LOW (SampleData) TO HIGH (SampleData) DO - BEGIN - IF Ndx <= Paramcount THEN - BEGIN - FileName := ParamStr (Ndx); - { Load the entire sound file from disk. } - SampleData[Ndx] := al_load_sample (FileName); - IF SampleData[Ndx] = NIL THEN - WriteLn ('Could not load sample from "', FileName, '"!'); - END - ELSE - SampleData[Ndx] := NIL; - END; - - WriteLn ('Press digits to play sounds, space to stop sounds, Escape to quit.'); - REPEAT - al_wait_for_event (EventQueue, Event); - CASE Event._type OF - ALLEGRO_EVENT_KEY_CHAR: - BEGIN - IF Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE THEN - EndLoop := TRUE; - IF Event.keyboard.unichar = ORD (' ') THEN - al_stop_samples - ELSE IF (ORD ('0') <= Event.keyboard.unichar) - AND (Event.keyboard.unichar <= ORD ('9')) THEN - BEGIN - IF Event.keyboard.unichar = ORD ('0') THEN - Ndx := 10 - ELSE - Ndx := (Event.keyboard.unichar - ORD ('0') + 10) MOD 10; - IF SampleData[Ndx] <> NIL THEN - BEGIN - WriteLn ('Playing ', Ndx); - IF NOT al_play_sample (SampleData[Ndx], 1, 0.5, 1, ALLEGRO_PLAYMODE_LOOP, NIL) THEN - WriteLn ('al_play_sample_data failed, perhaps too many sounds'); - END; - END; - END; - ALLEGRO_EVENT_DISPLAY_CLOSE: - EndLoop := TRUE; - END; - UNTIL EndLoop; -{ Sample data and other objects will be automatically freed. } - al_uninstall_audio; -END. - -/* vim: set sts=3 sw=3 et: */ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_blit.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_blit.pas deleted file mode 100644 index 0f0e33a0..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_blit.pas +++ /dev/null @@ -1,285 +0,0 @@ -PROGRAM ex_blit; -(* - * An example demonstrating different blending modes. - *) - USES - common, - Allegro5, al5font, al5image, al5color, - math, sysutils; - - VAR - Pattern: ALLEGRO_BITMAPptr; - Font: ALLEGRO_FONTptr; - Queue: ALLEGRO_EVENT_QUEUEptr; - Background, TextClr, White, Black, Red: ALLEGRO_COLOR; - Timer, Counter: ARRAY [1..4] OF DOUBLE; - FPS: INTEGER; - TextX, TextY: SINGLE; - - - - FUNCTION ExampleBitmap (CONST w, h: INTEGER): ALLEGRO_BITMAPptr; - VAR - i, j: INTEGER; - mx, my, a, d, sat, hue: SINGLE; - State: ALLEGRO_STATE; - Lock: ALLEGRO_LOCKED_REGIONptr; - Pattern: ALLEGRO_BITMAPptr; - Colour: ALLEGRO_COLOR; - BEGIN - mx := w * 0.5; - my := h * 0.5; - Pattern := al_create_bitmap (w, h); - al_store_state (State, ALLEGRO_STATE_TARGET_BITMAP); - al_set_target_bitmap (Pattern); - Lock := al_lock_bitmap (Pattern, ALLEGRO_PIXEL_FORMAT_ANY, ALLEGRO_LOCK_WRITEONLY); - FOR i := 0 TO w - 1 DO - BEGIN - FOR j := 0 TO h - 1 DO - BEGIN - a := arctan2 (i - mx, j - my); - d := sqrt (power (i - mx, 2) + power (j - my, 2)); - sat := power (1 - 1 / (1 + d * 0.1), 5); - hue := 3 * a * 180 / ALLEGRO_PI; - hue := (hue / 360 - floor (hue / 360)) * 360; - Colour := al_color_hsv (hue, sat, 1); - al_put_pixel (i, j, Colour); - END; - END; - al_put_pixel (0, 0, Black); - al_unlock_bitmap (Pattern); - al_restore_state (State); - ExampleBitmap := Pattern; - END; - - - - PROCEDURE SetXY (CONST x, y: SINGLE); - BEGIN - TextX := x; - TextY := y; - END; - - - - PROCEDURE GetXY (VAR x, y: SINGLE); - BEGIN - x := TextX; - y := TextY; - END; - - - - PROCEDURE Print (CONST Str: STRING); - VAR - th: INTEGER; - BEGIN - th := al_get_font_line_height (Font); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA); - al_draw_text (Font, TextClr, TextX, TextY, 0, Str); - TextY := TextY + th; - END; - - - - PROCEDURE StartTimer (Ndx: INTEGER); - BEGIN - Timer[Ndx] := Timer[Ndx] - al_get_time; - Counter[Ndx] := Counter[Ndx] + 1; - END; - - - - PROCEDURE StopTimer (Ndx: INTEGER); - BEGIN - Timer[Ndx] := Timer[Ndx] + al_get_time; - END; - - - - FUNCTION GetFPS (Ndx: INTEGER): SINGLE; - BEGIN - IF Timer[Ndx] = 0 THEN - GetFPS := 0 - ELSE - GetFPS := Counter[Ndx] / Timer[Ndx]; - END; - - - - PROCEDURE Draw; - VAR - x, y: SINGLE; - iw, ih, Size, Ndx, FormatLock: INTEGER; - Screen, Temp: ALLEGRO_BITMAPptr; - Lock: ALLEGRO_LOCKED_REGIONptr; - Data: POINTER; - BEGIN - iw := al_get_bitmap_width (Pattern); - ih := al_get_bitmap_height (Pattern); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_clear_to_color (Background); - Screen := al_get_target_bitmap; - - SetXY (8, 8); - - { Test 1. } - { /* Disabled: drawing to same bitmap is not supported. } - (* - Print ('Screen -> Screen (%.1f fps)', get_fps(0)); - get_xy(&x, &y); - al_draw_bitmap(ex.Pattern, x, y, 0); - - start_timer(0); - al_draw_bitmap_region(screen, x, y, iw, ih, x + 8 + iw, y, 0); - stop_timer(0); - set_xy(x, y + ih); - *) - - { Test 2. } - Print (Format ('Screen -> Bitmap -> Screen (%.1f fps)', [GetFPS (1)])); - GetXY (x, y); - al_draw_bitmap (Pattern, x, y, 0); - - Temp := al_create_bitmap (iw, ih); - al_set_target_bitmap (Temp); - al_clear_to_color (Red); - StartTimer (1); - al_draw_bitmap_region (Screen, x, y, iw, ih, 0, 0, 0); - - al_set_target_bitmap (Screen); - al_draw_bitmap (Temp, x + 8 + iw, y, 0); - StopTimer (1); - SetXY (x, y + ih); - - al_destroy_bitmap (Temp); - - { Test 3. } - Print (Format ('Screen -> Memory -> Screen (%.1f fps)', [getfps (2)])); - GetXY (x, y); - al_draw_bitmap (Pattern, x, y, 0); - - al_set_new_bitmap_flags (ALLEGRO_MEMORY_BITMAP); - Temp := al_create_bitmap (iw, ih); - al_set_target_bitmap (Temp); - al_clear_to_color (Red); - StartTimer (2); - al_draw_bitmap_region (Screen, x, y, iw, ih, 0, 0, 0); - - al_set_target_bitmap (Screen); - al_draw_bitmap (Temp, x + 8 + iw, y, 0); - StopTimer (2); - SetXY (x, y + ih); - - al_destroy_bitmap (Temp); - al_set_new_bitmap_flags (ALLEGRO_VIDEO_BITMAP); -(* - - /* Test 4. */ - Print ('Screen -> Locked -> Screen (%.1f fps)', get_fps(3)); - get_xy(&x, &y); - al_draw_bitmap(ex.Pattern, x, y, 0); - - StartTimer (3); - lock = al_lock_bitmap_region(Screen, x, y, iw, ih, - ALLEGRO_PIXEL_FORMAT_ANY, ALLEGRO_LOCK_READONLY); - format = lock->format; - size = lock->pixel_size; - data = malloc(size * iw * ih); - for (i = 0; i < ih; i++) - memcpy((char* )data + i * size * iw, - (char* )lock->data + i * lock->pitch, size * iw); - al_unlock_bitmap(Screen); - - lock = al_lock_bitmap_region(Screen, x + 8 + iw, y, iw, ih, format, - ALLEGRO_LOCK_WRITEONLY); - for (i = 0; i < ih; i++) - memcpy((char* )lock->data + i * lock->pitch, - (char* )data + i * size * iw, size * iw); - al_unlock_bitmap(Screen); - free(data); - StopTimer (3); - SetXY (x, y + ih); - *) - END; - - - - PROCEDURE Tick; - BEGIN - Draw; - al_flip_display; - END; - - - - PROCEDURE Run; - VAR - Event: ALLEGRO_EVENT; - NeedDraw: BOOLEAN; - BEGIN - NeedDraw := TRUE; - - REPEAT - IF NeedDraw AND al_is_event_queue_empty (Queue) THEN - BEGIN - Tick; - NeedDraw := FALSE; - END; - al_wait_for_event (Queue, Event); - CASE Event._type OF - ALLEGRO_EVENT_DISPLAY_CLOSE: - EXIT; - ALLEGRO_EVENT_KEY_DOWN: - IF Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE THEN - EXIT; - ALLEGRO_EVENT_TIMER: - NeedDraw := TRUE; - END; - UNTIL FALSE; - END; - - - - PROCEDURE Init; - BEGIN - FPS := 60; - Font := al_load_font ('data/fixed_font.tga', 0, 0); - IF Font = NIL THEN - AbortExample ('data/fixed_font.tga not found'); - Background := al_color_name ('beige'); - TextClr := al_color_name ('black'); - White := al_color_name ('white'); - Black := al_color_name ('black'); - Red := al_map_rgba_f (1, 0, 0, 1); - Pattern := ExampleBitmap (100, 100); - END; - - - -VAR - Display: ALLEGRO_DISPLAYptr; - TheTimer: ALLEGRO_TIMERptr; -BEGIN - IF NOT al_init THEN - AbortExample ('Could not init Allegro.'); - al_install_keyboard; - al_install_mouse; - al_init_image_addon; - al_init_font_addon; - Display := al_create_display (640, 480); - IF Display = NIL THEN - AbortExample ('Error creating display'); - Init; - TheTimer := al_create_timer (1 / FPS); - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_keyboard_event_source); - al_register_event_source (Queue, al_get_mouse_event_source); - al_register_event_source (Queue, al_get_display_event_source (Display)); - al_register_event_source (Queue, al_get_timer_event_source (TheTimer)); - al_start_timer (TheTimer); - Run; - al_destroy_event_queue (Queue); -{ Don't know why it fails at exit. But it doesn't fails if you press key "Esc" - before one second of execution (?). } -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_font.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_font.pas deleted file mode 100644 index d8a1b12a..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_font.pas +++ /dev/null @@ -1,132 +0,0 @@ -PROGRAM ex_font; -(* NIL DO - BEGIN - Next := Fl^.Next; - IF Fl^.EndTime > Now THEN - Prev := Fl - ELSE BEGIN - IF Prev <> NIL THEN - Prev^.Next := Next - ELSE - Flairs := Next; - FreeMem (Fl, SizeOf (TFlair)); - END; - Fl := Next; - END; - END; - - - - PROCEDURE FreeAllFlairs; - VAR - Next: PFlair; - BEGIN - WHILE Flairs <> NIL DO - BEGIN - Next := Flairs^.Next; - FreeMem (Flairs, SizeOf (TFlair)); - Flairs := Next; - END; - END; - - - -(**************************************************************************** - * Animations * - ****************************************************************************) - - FUNCTION GetNextAnim (CONST Spr: TSprite): PAnim; - VAR - DummyAnim: TAnim; - Ndx: LONGWORD; - BEGIN - FOR Ndx := LOW (Spr.Anims) TO HIGH (Spr.Anims) DO - IF Spr.Anims[Ndx].lval = NIL THEN - BEGIN - GetNextAnim := @(Spr.Anims[Ndx]); - EXIT; - END; - GetNextAnim := @DummyAnim; - END; - - - - PROCEDURE FixConflictingAnims (VAR Grp: TSprite; lVal: PSINGLE; StartTime, StartVal: SINGLE); - VAR - Ndx: LONGWORD; - Anim: PAnim; - BEGIN - FOR Ndx := LOW (Grp.Anims) TO HIGH (Grp.Anims) DO - BEGIN - Anim := @(Grp.Anims[Ndx]); - IF Anim^.lVal = lVal THEN - BEGIN - (* If an old animation would overlap with the new one, truncate it - * and make it converge to the new animation's starting value. *) - IF Anim^.EndTime > StartTime THEN - BEGIN - Anim^.EndTime := StartTime; - Anim^.EndVal := StartVal; - END; - (* Cancel any old animations which are scheduled to start after the - * new one, or which have been reduced to nothing. *) - IF (Anim^.StartTime >= StartTime) - OR (Anim^.StartTime >= Anim^.EndTime) THEN - Grp.Anims[Ndx].lVal := NIL; - END; - END; - END; - - - - PROCEDURE AnimFull (VAR Spr: TSprite; lVal: PSINGLE; StartVal, EndVal: SINGLE; Func: TInterp; Delay, Duration: SINGLE); - VAR - StartTime: SINGLE; - Anim: PAnim; - BEGIN - StartTime := al_get_time + Delay; - FixConflictingAnims (Spr, lVal, StartTime, StartVal); - Anim := GetNextAnim (Spr); - - Anim^.lVal := lVal; - Anim^.StartVal := StartVal; - Anim^.EndVal := EndVal; - Anim^.Func := Func; - Anim^.StartTime := StartTime; - Anim^.EndTime := StartTime + Duration; - END; - - - - PROCEDURE Anim (VAR Spr: TSprite; lVal: PSINGLE; StartVal, EndVal: SINGLE; Func: TInterp; Duration: SINGLE); - BEGIN - AnimFull (Spr, lVal, StartVal, EndVal, Func, 0, Duration); - END; - - - - PROCEDURE AnimTo (VAR Spr: TSprite; lVal: PSINGLE; EndVal: SINGLE; Func: TInterp; Duration: SINGLE); - BEGIN - AnimFull (Spr, lVal, lVal^, EndVal, Func, 0, Duration); - END; - - - - PROCEDURE AnimDelta (VAR Spr: TSprite; lVal: PSINGLE; Delta: SINGLE; Func: TInterp; Duration: SINGLE); - BEGIN - AnimFull (Spr, lVal, lVal^, lVal^ + Delta, Func, 0, Duration); - END; - - - - PROCEDURE AnimTint (VAR Spr: TSprite; CONST Color: ALLEGRO_COLOR; Func: TInterp; Duration: SINGLE); - VAR - R, G, B: SINGLE; - BEGIN - al_unmap_rgb_f (Color, R, G, B); - - AnimTo (Spr, @(Spr.r), R, Func, Duration); - AnimTo (Spr, @(Spr.g), G, Func, Duration); - AnimTo (Spr, @(Spr.b), B, Func, Duration); - END; - - - - FUNCTION Interpolate (Func: TInterp; t: SINGLE): SINGLE; - VAR - b, c, d: SINGLE; - BEGIN - CASE Func OF - INTERP_LINEAR: - Interpolate := t; - INTERP_FAST: - Interpolate := -t * (t - 2); - INTERP_DOUBLE_FAST: - BEGIN - t := t - 1; - Interpolate := t * t * t + 1; - END; - INTERP_SLOW: - Interpolate := t * t; - INTERP_DOUBLE_SLOW: - Interpolate := t * t * t; - INTERP_SLOW_IN_OUT: - BEGIN - { Quadratic easing in/out - acceleration until halfway, then deceleration. } - b := 0; { TODO: Why are these values in variables? } - c := 1; - d := 1; - t := t / (d / 2); - IF t < 1 THEN - Interpolate := c / 2 * t * t + b - ELSE BEGIN - t := t - 1; - Interpolate := (-c) / 2 * (t * (t - 2) - 1) + b - END; - END; - INTERP_BOUNCE: - BEGIN { TODO: Next comment may explay the previous TODO (WTF?) } - { BOUNCE EASING: exponentially decaying parabolic bounce - t: current time, b: beginning value, c: change in position, d: duration - bounce easing out } - IF t < (1 / 2.75) THEN - Interpolate := 7.5625 * t * t - ELSE IF t < (2 / 2.75) THEN - BEGIN - t := t - (1.5 / 2.75); - Interpolate := 7.5625 * t * t + 0.75 - END - ELSE IF t < (2.5 / 2.75) THEN - BEGIN - t := t - (2.5 / 2.75); - Interpolate := 7.5625 * t * t + 0.9375 - END - ELSE BEGIN - t := t - (2.625 / 2.75); - Interpolate := 7.5625 * t * t + 0.984375 - END; - END; - ELSE - Interpolate := 0.0 - END; - END; - - - - PROCEDURE UpdateAnim (VAR Anim: TAnim; Now: SINGLE); - VAR - dt, t, Range: SINGLE; - BEGIN - IF Anim.lVal = NIL THEN - EXIT; - IF Now < Anim.StartTime THEN - EXIT; - dt := Now - Anim.StartTime; - t := dt / (Anim. EndTime - Anim.StartTime); - IF t >= 1.0 THEN - BEGIN - { Animation has run to completion } - Anim.lVal^ := Anim.EndVal; - Anim.lVal := NIL; - EXIT; - END; - Range := Anim.EndVal - Anim.StartVal; - Anim.lVal^ := Anim.StartVal + Interpolate (Anim.Func, t) * Range; - END; - - - - PROCEDURE UpdateSpriteAnims (VAR Spr: TSprite; Now: SINGLE); - VAR - Ndx: INTEGER; - BEGIN - FOR Ndx := LOW (Spr.Anims) TO HIGH (Spr.Anims) DO - UpdateAnim (Spr.Anims[Ndx], Now); - END; - - - PROCEDURE UpdateTokenAnims (VAR Token: TToken; Now: SINGLE); - BEGIN - UpdateSpriteAnims (Token.Bot, Now); - UpdateSpriteAnims (Token.Top, Now); - END; - - - - PROCEDURE UpdateAnims (Now: SINGLE); - VAR - fl: PFlair; - Ndx: INTEGER; - BEGIN - FOR Ndx := LOW (Tokens) TO HIGH (Tokens) DO - UpdateTokenAnims (Tokens[Ndx], Now); - FOR Ndx := LOW (Buttons) TO HIGH (Buttons) DO - UpdateTokenAnims (Buttons[Ndx], Now); - UpdateSpriteAnims (Glow, Now); - UpdateSpriteAnims (GlowOverlay, Now); - fl := Flairs; - WHILE fl <> NIL DO - BEGIN - UpdateSpriteAnims (fl^.Sprite, Now); - fl := fl^.Next; - END; - END; - - - -(**************************************************************************** - * Drawing * - ****************************************************************************) - - PROCEDURE DrawSprite (CONST Spr: TSprite); - VAR - Bmp: ALLEGRO_BITMAPptr; - Tint: ALLEGRO_COLOR; - cx, cy: SINGLE; - BEGIN - Bmp := Images[Spr.Image]; - cx := Spr.AlignX * al_get_bitmap_width (Bmp); - cy := Spr.AlignY * al_get_bitmap_height (Bmp); - Tint := al_map_rgba_f (Spr.r, Spr.g, Spr.b, Spr.Opacity); - al_draw_tinted_scaled_rotated_bitmap ( - Bmp, Tint, cx, cy, - Spr.x, Spr.y, Spr.ScaleX, Spr.ScaleY, Spr.Angle, 0 - ); - END; - - - - PROCEDURE DrawToken (CONST Token: TToken); - BEGIN - DrawSprite (Token.Bot); - DrawSprite (Token.Top); - END; - - - - PROCEDURE DrawScreen; - VAR - fl: PFlair; - Ndx: INTEGER; - BEGIN - al_clear_to_color (al_map_rgb (0, 0, 0)); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ONE); - DrawSprite (Glow); - DrawSprite (GlowOverlay); - FOR Ndx := LOW (Tokens) TO HIGH (Tokens) DO - DrawToken (Tokens[Ndx]); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA); - FOR Ndx := LOW (Buttons) TO HIGH (Buttons) DO - DrawToken (Buttons[Ndx]); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ONE); - fl := Flairs; - WHILE fl <> NIL DO - BEGIN - DrawSprite (fl^.Sprite); - fl := fl^.Next; - END; - al_flip_display; - END; - - - -(**************************************************************************** - * Playback * - ****************************************************************************) - - PROCEDURE SpawnWindEffects (x, y: SINGLE); - VAR - Now: SINGLE; - Spr: PSprite; - BEGIN - Now := al_get_time; - Spr := CreateFlair (IMG_AIR_EFFECT, x, y, Now + 1); - Anim (Spr^, @(Spr^.ScaleX), 0.9, 1.3, INTERP_FAST, 1); - Anim (Spr^, @(Spr^.ScaleY), 0.9, 1.3, INTERP_FAST, 1); - Anim (Spr^, @(Spr^.Opacity), 1, 0, INTERP_FAST, 1); - Spr := CreateFlair (IMG_AIR_EFFECT, x, y, Now + 1.2); - Anim (Spr^, @(Spr^.Opacity), 1, 0, INTERP_LINEAR, 1.2); - Anim (Spr^, @(Spr^.ScaleX), 1.1, 1.5, INTERP_FAST, 1.2); - Anim (Spr^, @(Spr^.ScaleY), 1.1, 0.5, INTERP_FAST, 1.2); - AnimDelta (Spr^, @(spr^.x), 10, INTERP_FAST, 1.2); - END; - - - - PROCEDURE SpawnFireEffects (x, y: SINGLE); - VAR - Now: SINGLE; - Spr: PSprite; - i: INTEGER; - BEGIN - Now := al_get_time; - Spr := CreateFlair (IMG_MAIN_FLAME, x, y, Now + 0.8); - Spr^.AlignY := 0.75; - AnimFull (Spr^, @(Spr^.ScaleX), 0.2, 1.3, INTERP_BOUNCE, 0.0, 0.4); - AnimFull (Spr^, @(Spr^.ScaleY), 0.2, 1.3, INTERP_BOUNCE, 0.0, 0.4); - AnimFull (Spr^, @(Spr^.ScaleX), 1.3, 1.4, INTERP_BOUNCE, 0.4, 0.5); - AnimFull (Spr^, @(Spr^.ScaleY), 1.3, 1.4, INTERP_BOUNCE, 0.4, 0.5); - AnimFull (Spr^, @(Spr^.Opacity), 1.0, 0.0, INTERP_FAST, 0.3, 0.5); - FOR i := 0 TO 2 DO - BEGIN - Spr := CreateFlair (IMG_FLAME, x, y, Now + 0.7); - Spr^.AlignX := 1.3; - Spr^.Angle := TWOPI / 3 * i; - AnimDelta (Spr^, @(Spr^.Angle), -PI, INTERP_DOUBLE_FAST, 0.7); - Anim (Spr^, @(Spr^.Opacity), 1.0, 0.0, INTERP_SLOW, 0.7); - Anim (Spr^, @(Spr^.ScaleX), 0.2, 1.0, INTERP_FAST, 0.7); - Anim (Spr^, @(Spr^.ScaleY), 0.2, 1.0, INTERP_FAST, 0.7); - END; - END; - - - - PROCEDURE SpawnWaterEffects (x, y: SINGLE); - - FUNCTION RandomSign: SINGLE; - BEGIN - IF Random (2) < 1 THEN - RandomSign := -1 - ELSE - RandomSign := 1 - END; - - FUNCTION RandomFloat (Min, Max: SINGLE): SINGLE; - BEGIN - RandomFloat := Random * (Max - Min) + Min; - END; - - VAR - MaxDuration: SINGLE; - - FUNCTION MRand (Min, Max: SINGLE): SINGLE; - BEGIN - MRand := RandomFloat (Min, Max) * MaxDuration; - END; - - VAR - Now: SINGLE; - Spr: PSprite; - i: INTEGER; - BEGIN - Now := al_get_time; - MaxDuration := 1.0; { TODO: Why is this value a variable? } - Spr := CreateFlair (IMG_WATER, x, y, Now + MaxDuration); - Anim (Spr^, @(Spr^.ScaleX), 1.0, 2.0, INTERP_FAST, 0.5); - Anim (Spr^, @(Spr^.ScaleY), 1.0, 2.0, INTERP_FAST, 0.5); - Anim (Spr^, @(Spr^.Opacity), 0.5, 0.0, INTERP_FAST, 0.5); - FOR i := 0 TO 8 DO - BEGIN - Spr := CreateFlair (IMG_WATER_DROPS, x, y, Now + MaxDuration); - Spr^.ScaleX := RandomFloat (0.3, 1.2) * RandomSign; - Spr^.ScaleY := RandomFloat (0.3, 1.2) * RandomSign; - Spr^.Angle := RandomFloat (0, TWOPI); - Spr^.r := RandomFloat (0, 0.6); - Spr^.g := RandomFloat (0.4, 0.6); - Spr^.b := 1; - IF i = 0 THEN - AnimTo (Spr^, @(Spr^.Opacity), 0, INTERP_LINEAR, MaxDuration) - ELSE - AnimTo (Spr^, @(Spr^.Opacity), 0, INTERP_DOUBLE_SLOW, MRand (0.7, 1)); - AnimTo (Spr^, @(Spr^.ScaleX), RandomFloat (0.8, 3), INTERP_FAST, MRand (0.7, 1)); - AnimTo (Spr^, @(Spr^.ScaleY), RandomFloat (0.8, 3), INTERP_FAST, MRand (0.7, 1)); - AnimTo (Spr^, @(Spr^.X), MRand (0, 20) * RandomSign, INTERP_FAST, MRand (0.7, 1)); - AnimTo (Spr^, @(Spr^.Y), MRand (0, 20) * RandomSign, INTERP_FAST, MRand (0.7, 1)); - END; - END; - - - - PROCEDURE PlayElement (TheType, Pitch: INTEGER; Volume, Pan: SINGLE); - BEGIN - al_play_sample (ElementSamples[TheType][Pitch], Volume, Pan, 1.0, ALLEGRO_PLAYMODE_ONCE, NIL); - END; - - - - PROCEDURE ActivateToken (Token: TToken); - CONST - sc = TokenScale; - VAR - Spr: PSprite; - BEGIN - Spr := @(Token.Top); - CASE Token.TheType OF - TYPE_EARTH: - BEGIN - PlayElement (TYPE_EARTH, Token.Pitch, 0.8, 0.0); - Anim (Spr^, @(Spr^.ScaleX), Spr^.ScaleX + 0.4, Spr^.ScaleX, INTERP_FAST, 0.3); - Anim (Spr^, @(Spr^.ScaleY), Spr^.ScaleY + 0.4, Spr^.ScaleY, INTERP_FAST, 0.3); - END; - TYPE_WIND: - BEGIN - PlayElement (TYPE_WIND, Token.Pitch, 0.8, 0.0); - AnimFull (Spr^, @(Spr^.ScaleX), sc * 1.0, sc * 0.8, INTERP_SLOW_IN_OUT, 0.0, 0.5); - AnimFull (Spr^, @(Spr^.ScaleX), sc * 0.8, sc * 1.0, INTERP_SLOW_IN_OUT, 0.5, 0.8); - AnimFull (Spr^, @(Spr^.ScaleY), sc * 1.0, sc * 0.8, INTERP_SLOW_IN_OUT, 0.0, 0.5); - AnimFull (Spr^, @(Spr^.ScaleY), sc * 0.8, sc * 1.0, INTERP_SLOW_IN_OUT, 0.5, 0.8); - SpawnWindEffects (Spr^.x, Spr^.y); - END; - TYPE_WATER: - BEGIN - PlayElement (TYPE_WATER, Token.Pitch, 0.7, 0.5); - AnimFull (Spr^, @(Spr^.ScaleX), sc * 1.3, sc * 0.8, INTERP_BOUNCE, 0.0, 0.5); - AnimFull (Spr^, @(Spr^.ScaleX), sc * 0.8, sc * 1.0, INTERP_BOUNCE, 0.5, 0.5); - AnimFull (Spr^, @(Spr^.ScaleY), sc * 0.8, sc * 1.3, INTERP_BOUNCE, 0.0, 0.5); - AnimFull (Spr^, @(Spr^.ScaleY), sc * 1.3, sc * 1.0, INTERP_BOUNCE, 0.5, 0.5); - SpawnWaterEffects (Spr^.x, Spr^.y); - END; - TYPE_FIRE: - BEGIN - PlayElement (TYPE_FIRE, Token.Pitch, 0.8, 0.0); - Anim (Spr^, @(Spr^.ScaleX), sc * 1.3, sc, INTERP_SLOW_IN_OUT, 1.0); - Anim (Spr^, @(Spr^.ScaleY), sc * 1.3, sc, INTERP_SLOW_IN_OUT, 1.0); - SpawnFireEffects (Spr^.x, Spr^.y); - END; - END; - END; - - - - PROCEDURE UpdatePlayback; - VAR - y: INTEGER; - BEGIN - FOR Y := 0 TO (TOKENS_Y - 1) DO - ActivateToken (Tokens[Y * TOKENS_X + PlaybackColumn]); - INC (PlaybackColumn); - IF PlaybackColumn >= TOKENS_X THEN - PlaybackColumn := 0; - END; - -(**************************************************************************** - * Control * - ****************************************************************************) - - FUNCTION IsTouched (Token: TToken; Size, x, y: SINGLE): BOOLEAN; - VAR - Half: SINGLE; - BEGIN - Half := Size / 2; - IsTouched := (Token.x - Half <= x) AND (x < Token.x + Half) - AND (Token.y - Half <= y) AND (y < Token.y + Half) - END; - - - - FUNCTION GetTouchedToken (x, y: SINGLE): PToken; - VAR - Ndx: INTEGER; - BEGIN - GetTouchedToken := NIL; - FOR Ndx := LOW (Tokens) TO HIGH (Tokens) DO - IF IsTouched (Tokens[Ndx], TokenSize, x, y) THEN - BEGIN - GetTouchedToken := @Tokens[Ndx]; - EXIT; - END; - END; - - - - FUNCTION GetTouchedButton (x, y: SINGLE): PToken; - VAR - Ndx: INTEGER; - BEGIN - GetTouchedButton := NIL; - FOR Ndx := LOW (Buttons) TO HIGH (Buttons) DO - IF IsTouched (Buttons[Ndx], ButtonSize, x, y) THEN - BEGIN - GetTouchedButton := @Buttons[Ndx]; - EXIT; - END; - END; - - - - PROCEDURE SelectToken (Token: PToken); - VAR - Spr: PSprite; - BEGIN - IF (Token^.TheType = TYPE_NONE) AND (SelectedButton <> NIL) THEN - BEGIN - Spr := @(Token^.Top); - Spr^.Image := SelectedButton^.TheType; - AnimTo (Spr^, @(Spr^.Opacity), 1, INTERP_FAST, 0.15); - Token^.TheType := SelectedButton^.TheType; - END; - END; - - - - PROCEDURE UnselectToken (Token: PToken); - VAR - Spr: PSprite; - BEGIN - IF Token^.TheType <> TYPE_NONE THEN - BEGIN - Spr := @(Token^.Top); - AnimFull (Spr^, @(Spr^.Opacity), Spr^.Opacity, 0, INTERP_SLOW, 0.15, 0.15); - Token^.TheType := TYPE_NONE; - END; - END; - - - - PROCEDURE UnselectAllTokens; - VAR - Ndx: INTEGER; - BEGIN - FOR Ndx := LOW (Tokens) TO HIGH (Tokens) DO - UnselectToken (@Tokens[Ndx]); - END; - - - - PROCEDURE ChangeHealthyGlow (TheType: INTEGER; x: SINGLE); - BEGIN - AnimTint (Glow, GlowColor[TheType], INTERP_SLOW_IN_OUT, 3.0); - AnimTo (Glow, @Glow.x, x, INTERP_SLOW_IN_OUT, 3.0); - - AnimTint (GlowOverlay, GlowColor[TheType], INTERP_SLOW_IN_OUT, 4.0); - AnimTo (GlowOverlay, @GlowOverlay.Opacity, 1.0, INTERP_SLOW_IN_OUT, 4.0); - END; - - - - PROCEDURE SelectButton (Button: PToken); - VAR - Spr: PSprite; - BEGIN - IF Button = SelectedButton THEN - EXIT; - IF SelectedButton <> NIL THEN - BEGIN - Spr := @(SelectedButton^.Top); - AnimTo (Spr^, @(Spr^.ScaleX), ButtonUnselScale, INTERP_SLOW, 0.3); - AnimTo (Spr^, @(Spr^.ScaleY), ButtonUnselScale, INTERP_SLOW, 0.3); - AnimTo (Spr^, @(Spr^.Opacity), 0.5, INTERP_DOUBLE_SLOW, 0.2); - - Spr := @(SelectedButton^.Bot); - AnimTo (Spr^, @(Spr^.ScaleX), DropshadowUnselScale, INTERP_SLOW, 0.3); - AnimTo (Spr^, @(Spr^.ScaleY), DropshadowUnselScale, INTERP_SLOW, 0.3); - END; - SelectedButton := Button; - Spr := @(Button^.Top); - AnimTo (Spr^, @(Spr^.ScaleX), ButtonSelScale, INTERP_FAST, 0.3); - AnimTo (Spr^, @(Spr^.ScaleY), ButtonSelScale, INTERP_FAST, 0.3); - AnimTo (Spr^, @(Spr^.Opacity), 1.0, INTERP_FAST, 0.3); - Spr := @(Button^.Bot); - AnimTo (Spr^, @(Spr^.ScaleX), DropshadowSelScale, INTERP_FAST, 0.3); - AnimTo (Spr^, @(Spr^.ScaleY), DropshadowSelScale, INTERP_FAST, 0.3); - ChangeHealthyGlow (Button^.TheType, Button^.x); - al_play_sample (SelectSample, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NIL); - END; - - - - PROCEDURE onMouseDown (x, y: SINGLE; mButton: INTEGER); - VAR - Token, Button: PToken; - BEGIN - IF mButton = 1 THEN - BEGIN - Token := GetTouchedToken (x, y); - IF Token <> NIL THEN - SelectToken (Token) - ELSE BEGIN - Button := GetTouchedButton (x, y); - IF Button <> NIL THEN - SelectButton (Button); - END; - END - ELSE IF mButton = 2 THEN - BEGIN - Token := GetTouchedToken (x, y); - IF Token <> NIL THEN - UnselectToken (Token); - END; - END; - - - - PROCEDURE onMouseAxes (x, y: SINGLE); - VAR - Token: PToken; - Spr: PSprite; - BEGIN - Token := GetTouchedToken (x, y); - IF Token = HoverToken THEN - EXIT; - IF HoverToken <> NIL THEN - BEGIN - Spr := @(HoverToken^.Bot); - AnimTo (Spr^, @(Spr^.Opacity), 0.4, INTERP_DOUBLE_SLOW, 0.2); - END; - HoverToken := Token; - IF HoverToken <> NIL THEN - BEGIN - Spr := @(HoverToken^.Bot); - AnimTo (Spr^, @(Spr^.Opacity), 0.7, INTERP_FAST, 0.2); - END; - END; - - - - PROCEDURE MainLoop (Queue: ALLEGRO_EVENT_QUEUEptr); - VAR - Event: ALLEGRO_EVENT; - EndLoop, Redraw: BOOLEAN; - Now: SINGLE; - BEGIN - EndLoop := FALSE; - Redraw := TRUE; - REPEAT - IF Redraw AND al_is_event_queue_empty (Queue) THEN - BEGIN - Now := al_get_time; - FreeOldFlairs (Now); - UpdateAnims (Now); - DrawScreen; - Redraw := FALSE; - END; - - al_wait_for_event (Queue, Event); - - IF Event.timer.source = RefreshTimer THEN - Redraw := true - ELSE IF Event.timer.source = PlaybackTimer THEN - UpdatePlayback - ELSE IF Event._type = ALLEGRO_EVENT_MOUSE_AXES THEN - onMouseAxes (Event.mouse.x, Event.mouse.y) - ELSE IF Event._type = ALLEGRO_EVENT_MOUSE_BUTTON_DOWN THEN - onMouseDown (event.mouse.x, event.mouse.y, event.mouse.button) - ELSE IF Event._type = ALLEGRO_EVENT_DISPLAY_CLOSE THEN - EndLoop := TRUE - ELSE IF Event._type = ALLEGRO_EVENT_KEY_DOWN THEN - BEGIN - IF Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE THEN - EndLoop := TRUE; - IF Event.keyboard.keycode = ALLEGRO_KEY_C THEN - UnselectAllTokens; - END; - UNTIL EndLoop; - END; - -VAR - Queue: ALLEGRO_EVENT_QUEUEptr; -BEGIN - IF NOT al_init THEN - AbortExample ('Error initialising Allegro.'); - IF NOT al_install_audio OR NOT al_reserve_samples (128) THEN - AbortExample ('Error initialising audio.'); - al_init_acodec_addon(); - al_init_image_addon(); - - al_set_new_bitmap_flags (ALLEGRO_MIN_LINEAR OR ALLEGRO_MAG_LINEAR); - - Display := al_create_display (ScreenW, ScreenH); - IF Display = NIL THEN - AbortExample ('Error creating display.'); - al_set_window_title (Display, 'Haiku - A Musical Instrument'); - - LoadImages; - LoadSamples; - - InitTokens; - InitButtons; - InitGlow; - SelectButton (@(Buttons[TYPE_EARTH])); - - al_install_keyboard; - al_install_mouse; - - RefreshTimer := al_create_timer (1.0 / RefreshRate); - PlaybackTimer := al_create_timer (PlaybackPeriod / TOKENS_X); - - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_display_event_source (Display)); - al_register_event_source (Queue, al_get_keyboard_event_source); - al_register_event_source (Queue, al_get_mouse_event_source); - al_register_event_source (Queue, al_get_timer_event_source (RefreshTimer)); - al_register_event_source (Queue, al_get_timer_event_source (PlaybackTimer)); - - al_start_timer (RefreshTimer); - al_start_timer (PlaybackTimer); - - MainLoop (Queue); - - FreeAllFlairs; -END. - -/* vim: set sts=3 sw=3 et: */ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_lines.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_lines.pas deleted file mode 100644 index 861e716f..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_lines.pas +++ /dev/null @@ -1,185 +0,0 @@ -PROGRAM ex_lines; -(* - * This example exercises line drawing, and single buffer mode. - *) -USES - common, - Allegro5, - al5primitives; - -(* XXX the software line drawer currently doesn't perform clipping properly *) - - CONST - W = 640; - H = 480; - - VAR - Display: ALLEGRO_DISPLAYptr; - Queue: ALLEGRO_EVENT_QUEUEptr; - Black, White, Background: ALLEGRO_COLOR; - dBuf: ALLEGRO_BITMAPptr; - - LastX: INTEGER = -1; - LastY: INTEGER = -1; - - PROCEDURE Fade; - BEGIN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA); - al_draw_filled_rectangle (0, 0, W, H, al_map_rgba_f (0.5, 0.5, 0.6, 0.2)); - END; - - - - PROCEDURE RedDot (x, y: INTEGER); - BEGIN - al_draw_filled_rectangle (x - 2, y - 2, x + 2, y + 2, al_map_rgb_f (1, 0, 0)); - END; - - - - PROCEDURE DrawClipRect; - BEGIN - al_draw_rectangle (100.5, 100.5, W - 100.5, H - 100.5, Black, 0); - END; - - - - PROCEDURE SetClipRect; - BEGIN - al_set_clipping_rectangle (100, 100, W - 200, H - 200); - END; - - - - PROCEDURE ResetClipRect; - BEGIN - al_set_clipping_rectangle (0, 0, W, H); - END; - - - - PROCEDURE Flip; - BEGIN - al_set_target_backbuffer (Display); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_draw_bitmap (dBuf, 0.0, 0.0, 0); - al_flip_display; - END; - - - PROCEDURE Plonk (CONST x, y: INTEGER; Blend: BOOLEAN); - BEGIN - al_set_target_bitmap (dBuf); - - Fade; - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ZERO); - DrawClipRect; - RedDot (x, y); - - IF (LastX = -1) AND (LastY = -1) THEN - BEGIN - LastX := x; - LastY := y; - END - ELSE BEGIN - SetClipRect; - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA); - al_draw_line (LastX, LastY, x, y, white, 0); - LastX := -1; - LastY := -1; - ResetClipRect; - END; - Flip; - END; - - - - PROCEDURE Splat (CONST x, y: INTEGER; Blend: BOOLEAN); - VAR - Theta: SINGLE; - BEGIN - al_set_target_bitmap (dBuf); - - Fade; - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ZERO); - DrawClipRect; - RedDot (x, y); - - SetClipRect; - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA); - Theta := 0; - REPEAT - al_draw_line (x, y, x + 40.0 * cos (Theta), y + 40.0 * sin (Theta), White, 0); - Theta := Theta + ALLEGRO_PI / 16; - UNTIL Theta >= 2 * ALLEGRO_PI; - ResetClipRect; - - Flip; - END; - - - -VAR - Event: ALLEGRO_EVENT; - KeyboardState: ALLEGRO_KEYBOARD_STATE; - Blend, EndLoop: BOOLEAN; -BEGIN - IF NOT al_init THEN - AbortExample ('Could not init Allegro'); - - al_init_primitives_addon; - al_install_keyboard; - al_install_mouse; - - Display := al_create_display (W, H); - IF Display = NIL THEN - AbortExample ('Error creating display'); - - Black := al_map_rgb_f (0.0, 0.0, 0.0); - White := al_map_rgb_f (1.0, 1.0, 1.0); - Background := al_map_rgb_f (0.5, 0.5, 0.6); - - IF (Paramcount > 0) AND (Paramstr (1) = '--memory-bitmap') THEN - al_set_new_bitmap_flags (ALLEGRO_MEMORY_BITMAP); - dBuf := al_create_bitmap (W, H); - IF dBuf = NIL THEN - AbortExample ('Error creating double buffer'); - - al_set_target_bitmap (dBuf); - al_clear_to_color (Background); - DrawClipRect; - Flip; - - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_keyboard_event_source); - al_register_event_source (Queue, al_get_mouse_event_source); - - EndLoop := FALSE; - REPEAT - al_wait_for_event (Queue, Event); - IF Event._type = ALLEGRO_EVENT_MOUSE_BUTTON_DOWN THEN - BEGIN - al_get_keyboard_state (KeyboardState); - Blend := al_key_down (KeyboardState, ALLEGRO_KEY_LSHIFT) - OR al_key_down (KeyboardState, ALLEGRO_KEY_RSHIFT); - IF Event.mouse.button = 1 THEN - Plonk (Event.mouse.x, Event.mouse.y, Blend) - ELSE - Splat (Event.mouse.x, Event.mouse.y, Blend); - END - ELSE IF Event._type = ALLEGRO_EVENT_DISPLAY_SWITCH_OUT THEN - BEGIN - LastX := -1; - LastY := -1; - END - ELSE IF (Event._type = ALLEGRO_EVENT_KEY_DOWN) - AND (Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE) THEN - EndLoop := TRUE; - UNTIL EndLoop; - - al_destroy_event_queue (Queue); - al_destroy_bitmap (dBuf); -END. -/* vim: set sts=3 sw=3 et: */ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_prim.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_prim.pas deleted file mode 100644 index 4d2a034e..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_prim.pas +++ /dev/null @@ -1,746 +0,0 @@ -PROGRAM ex_prim; -(* ______ ___ ___ - * /\ _ \ /\_ \ /\_ \ - * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ - * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ - * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ - * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ - * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ - * /\____/ - * \_/__/ - * - * A sampler of the primitive addon. - * All primitives are rendered using the additive blender, so overdraw will manifest itself as overly bright pixels. - * - * - * By Pavel Sountsov. - * Translated to Pascal by Ñuño Martínez. - * - * See readme.txt for copyright information. - *) - -{$LONGSTRINGS ON} - - USES - common, - Allegro5, al5font, al5image, al5primitives, - sysutils; - - - TYPE - - TMODE = ( - INIT, - LOGIC, - DRAW - ); - - - - ScreenProcedure = PROCEDURE (Mode: TMODE); - - - - CUSTOM_VERTEX = RECORD - u, v, x, y: SMALLINT; - Color: ALLEGRO_COLOR; - Junk: ARRAY [1..6] OF INTEGER; - END; - - - - CONST - ScreenW = 800; - ScreenH = 600; - NUM_SCREENS = 10; - ROTATE_SPEED = 0.0001; - - VAR - Screens: ARRAY [1..NUM_SCREENS] OF ScreenProcedure; - ScreenName: ARRAY [1..NUM_SCREENS] OF STRING; - Font: ALLEGRO_FONTptr; - Identity: ALLEGRO_TRANSFORM; - Buffer, Texture: ALLEGRO_BITMAPptr; - SolidWhite: ALLEGRO_COLOR; - - Soft: BOOLEAN = FALSE; - Blend: BOOLEAN = TRUE; - Speed: SINGLE = ROTATE_SPEED; - Theta: SINGLE; - Background: BOOLEAN = TRUE; - Thickness: SINGLE = 0; - MainTrans: ALLEGRO_TRANSFORM; - - - - PROCEDURE CustomVertexFormatPrimitives (Mode: TMODE); - VAR - vtx: ARRAY [1..4] OF CUSTOM_VERTEX; - Decl: ALLEGRO_VERTEX_DECLptr; - Ndx, x, y: INTEGER; - CONST - Elems: ARRAY [1..4] OF ALLEGRO_VERTEX_ELEMENT = ( - { NOTE: There's no way to get the field offset at runtime, - so we assume 16bit for SMALLINT. } - (attribute: ALLEGRO_PRIM_POSITION; storage: ALLEGRO_PRIM_SHORT_2; offset: 4), - (attribute: ALLEGRO_PRIM_TEX_COORD_PIXEL; storage: ALLEGRO_PRIM_SHORT_2; offset: 0), - (attribute: ALLEGRO_PRIM_COLOR_ATTR; storage: ALLEGRO_PRIM_STORAGE_NONE; offset: 8), - (attribute: ALLEGRO_PRIM_ATTR_NONE; storage: ALLEGRO_PRIM_STORAGE_NONE; offset: 0) - ); - BEGIN - CASE Mode OF - INIT: - BEGIN - Decl := al_create_vertex_decl (@Elems[LOW (Elems)], sizeof (CUSTOM_VERTEX)); - FOR Ndx := LOW (vtx) TO HIGH (vtx) DO - BEGIN - x := TRUNC (200 * cos (Ndx DIV 4 * 2 * ALLEGRO_PI)); - y := TRUNC (200 * sin (Ndx DIV 4 * 2 * ALLEGRO_PI)); - vtx[Ndx].x := x; vtx[Ndx].y := y; - vtx[Ndx].u := 64 * x DIV 100; vtx[Ndx].v := 64 * y DIV 100; - vtx[Ndx].Color := al_map_rgba_f (1, 1, 1, 1); - END; - END; - LOGIC: - BEGIN - Theta := Theta + Speed; - al_build_transform (MainTrans, ScreenW DIV 2, ScreenH DIV 2, 1, 1, Theta); - END; - DRAW: - BEGIN - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE) - ELSE - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_use_transform (MainTrans); - al_draw_prim (@vtx[LOW (vtx)], Decl, Texture, 0, 4, ALLEGRO_PRIM_TRIANGLE_FAN); - al_use_transform (Identity); - END; - END; - END; - - - - PROCEDURE TexturePrimitives (Mode: TMODE); - VAR - vtx, vtx2: ARRAY [1..13] OF ALLEGRO_VERTEX; - Ndx, x, y: INTEGER; - Color: ALLEGRO_COLOR; - BEGIN - CASE Mode OF - INIT: - FOR Ndx := LOW (vtx) TO HIGH (vtx) DO - BEGIN - x := TRUNC (200 * cos (Ndx DIV 13 * 2 * ALLEGRO_PI)); - y := TRUNC (200 * sin (Ndx DIV 13 * 2 * ALLEGRO_PI)); - Color := al_map_rgb ((Ndx + 1) MOD 3 * 64, (Ndx + 2) MOD 3 * 64, Ndx MOD 3 * 64); - vtx[Ndx].x := x; vtx[Ndx].y := y; vtx[Ndx].z := 0; - vtx2[Ndx].x := 0.1 * x; vtx2[Ndx].y := 0.1 * y; - vtx[Ndx].u := 64 * x DIV 100; vtx[Ndx].v := 64 * y DIV 100; - vtx2[Ndx].u := 64 * x DIV 100; vtx2[Ndx].v := 64 * y DIV 100; - IF Ndx < 10 THEN - vtx[Ndx].Color := al_map_rgba_f (1, 1, 1, 1) - ELSE - vtx[Ndx].Color := Color; - vtx2[Ndx].Color := vtx[Ndx].Color; - END; - LOGIC: - BEGIN - Theta := Theta + Speed; - al_build_transform (MainTrans, ScreenW DIV 2, ScreenH DIV 2, 1, 1, Theta); - END; - DRAW: - BEGIN - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE) - ELSE - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_use_transform (MainTrans); - al_draw_prim (@vtx[LOW (vtx)], NIL, Texture, 0, 4, ALLEGRO_PRIM_LINE_LIST); - al_draw_prim (@vtx[LOW (vtx)], NIL, Texture, 4, 9, ALLEGRO_PRIM_LINE_STRIP); - al_draw_prim (@vtx[LOW (vtx)], NIL, Texture, 9, 13, ALLEGRO_PRIM_LINE_LOOP); - al_draw_prim (@vtx2[LOW (vtx2)], NIL, Texture, 0, 13, ALLEGRO_PRIM_POINT_LIST); - al_use_transform (Identity); - END; - END; - END; - - - - PROCEDURE FilledTexturePrimitives (Mode: TMODE); - VAR - vtx: ARRAY [1..21] OF ALLEGRO_VERTEX; - Ndx, x, y: INTEGER; - Color: ALLEGRO_COLOR; - BEGIN - CASE Mode OF - INIT: - FOR Ndx := LOW (vtx) TO HIGH (vtx) DO - BEGIN - IF Ndx MOD 2 = 0 THEN - BEGIN - x := TRUNC (150 * cos (Ndx DIV 20 * 2 * ALLEGRO_PI)); - y := TRUNC (150 * sin (Ndx DIV 20 * 2 * ALLEGRO_PI)); - END - ELSE BEGIN - x := TRUNC (200 * cos (Ndx DIV 20 * 2 * ALLEGRO_PI)); - y := TRUNC (200 * sin (Ndx DIV 20 * 2 * ALLEGRO_PI)); - END; - IF Ndx = 0 THEN - BEGIN - x := 0; y := 0; - END; - Color := al_map_rgb ((7 * Ndx + 1) MOD 3 * 64, (2 * Ndx + 2) MOD 3 * 64, Ndx MOD 3 * 64); - vtx[Ndx].x := x; vtx[Ndx].y := y; vtx[Ndx].z := 0; - vtx[Ndx].u := 64 * x DIV 100; vtx[Ndx].v := 64 * y DIV 100; - IF Ndx < 10 THEN - vtx[Ndx].Color := al_map_rgba_f (1, 1, 1, 1) - ELSE - vtx[Ndx].Color := Color; - END; - LOGIC: - BEGIN - Theta := Theta + Speed; - al_build_transform (MainTrans, ScreenW DIV 2, ScreenH DIV 2, 1, 1, Theta); - END; - DRAW: - BEGIN - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE) - ELSE - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_use_transform (MainTrans); - al_draw_prim (@vtx[LOW (vtx)], NIL, Texture, 0, 6, ALLEGRO_PRIM_TRIANGLE_FAN); - al_draw_prim (@vtx[LOW (vtx)], NIL, Texture, 7, 13, ALLEGRO_PRIM_TRIANGLE_LIST); - al_draw_prim (@vtx[LOW (vtx)], NIL, Texture, 14, 20, ALLEGRO_PRIM_TRIANGLE_STRIP); - al_use_transform (Identity); - END; - END; - END; - - - - PROCEDURE FilledPrimitives (Mode: TMODE); - VAR - vtx: ARRAY [1..21] OF ALLEGRO_VERTEX; - Ndx, x, y: INTEGER; - Color: ALLEGRO_COLOR; - BEGIN - CASE Mode OF - INIT: - FOR Ndx := LOW (vtx) TO HIGH (vtx) DO - BEGIN - IF Ndx MOD 2 = 0 THEN - BEGIN - x := TRUNC (150 * cos (Ndx DIV 20 * 2 * ALLEGRO_PI)); - y := TRUNC (150 * sin (Ndx DIV 20 * 2 * ALLEGRO_PI)); - END - ELSE BEGIN - x := TRUNC (200 * cos (Ndx DIV 20 * 2 * ALLEGRO_PI)); - y := TRUNC (200 * sin (Ndx DIV 20 * 2 * ALLEGRO_PI)); - END; - IF Ndx = 0 THEN - BEGIN - x := 0; y := 0; - END; - Color := al_map_rgb ((7 * Ndx + 1) MOD 3 * 64, (2 * Ndx + 2) MOD 3 * 64, Ndx MOD 3 * 64); - vtx[Ndx].x := x; vtx[Ndx].y := y; vtx[Ndx].z := 0; - vtx[Ndx].u := 64 * x DIV 100; vtx[Ndx].v := 64 * y DIV 100; - IF Ndx < 10 THEN - vtx[Ndx].Color := al_map_rgba_f (1, 1, 1, 1) - ELSE - vtx[Ndx].Color := Color; - END; - LOGIC: - BEGIN - Theta := Theta + Speed; - al_build_transform (MainTrans, ScreenW DIV 2, ScreenH DIV 2, 1, 1, Theta); - END; - DRAW: - BEGIN - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE) - ELSE - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_use_transform (MainTrans); - al_draw_prim (@vtx[LOW (vtx)], NIL, NIL, 0, 6, ALLEGRO_PRIM_TRIANGLE_FAN); - al_draw_prim (@vtx[LOW (vtx)], NIL, NIL, 7, 13, ALLEGRO_PRIM_TRIANGLE_LIST); - al_draw_prim (@vtx[LOW (vtx)], NIL, NIL, 14, 20, ALLEGRO_PRIM_TRIANGLE_STRIP); - al_use_transform (Identity); - END; - END; - END; - -(* -static void IndexedFilledPrimitives(Mode: TMODE) -{ - static ALLEGRO_VERTEX vtx[21]; - static int indices1[] = {12, 13, 14, 16, 17, 18}; - static int indices2[] = {6, 7, 8, 9, 10, 11}; - static int indices3[] = {0, 1, 2, 3, 4, 5}; - if (mode == INIT) { - int Ndx = 0; - for (Ndx = 0; Ndx < 21; Ndx++) { - float x, y; - ALLEGRO_COLOR color; - if (Ndx % 2 == 0) { - x = 150 * cosf((float)Ndx / 20 * 2 * ALLEGRO_PI); - y = 150 * sinf((float)Ndx / 20 * 2 * ALLEGRO_PI); - } else { - x = 200 * cosf((float)Ndx / 20 * 2 * ALLEGRO_PI); - y = 200 * sinf((float)Ndx / 20 * 2 * ALLEGRO_PI); - } - - if (Ndx == 0) { - x = y = 0; - } - - color = al_map_rgb((7 * Ndx + 1) % 3 * 64, (2 * Ndx + 2) % 3 * 64, (Ndx) % 3 * 64); - - vtx[Ndx].x = x; vtx[Ndx].y = y; vtx[Ndx].z = 0; - vtx[Ndx].color = color; - } - } else if (mode == LOGIC) { - int Ndx; - Theta += Speed; - for (Ndx = 0; Ndx < 6; Ndx++) { - indices1[Ndx] = ((int)al_get_time() + Ndx) % 20 + 1; - indices2[Ndx] = ((int)al_get_time() + Ndx + 6) % 20 + 1; - if (Ndx > 0) - indices3[Ndx] = ((int)al_get_time() + Ndx + 12) % 20 + 1; - } - - al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); - } else if (mode == DRAW) { - if (Blend) - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - else - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - - al_use_transform(&MainTrans); - - al_draw_indexed_prim(vtx, 0, 0, indices1, 6, ALLEGRO_PRIM_TRIANGLE_LIST); - al_draw_indexed_prim(vtx, 0, 0, indices2, 6, ALLEGRO_PRIM_TRIANGLE_STRIP); - al_draw_indexed_prim(vtx, 0, 0, indices3, 6, ALLEGRO_PRIM_TRIANGLE_FAN); - - al_use_transform(&Identity); - } -} - -static void HighPrimitives(Mode: TMODE) -{ - if (mode == INIT) { - - } else if (mode == LOGIC) { - Theta += Speed; - al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); - } else if (mode == DRAW) { - float points[8] = { - -300, -200, - 700, 200, - -700, 200, - 300, -200 - }; - - if (Blend) - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - else - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - - al_use_transform(&MainTrans); - - al_draw_line(-300, -200, 300, 200, al_map_rgba_f(0, 0.5, 0.5, 1), Thickness); - al_draw_triangle(-150, -250, 0, 250, 150, -250, al_map_rgba_f(0.5, 0, 0.5, 1), Thickness); - al_draw_rectangle(-300, -200, 300, 200, al_map_rgba_f(0.5, 0, 0, 1), Thickness); - al_draw_rounded_rectangle(-200, -125, 200, 125, 50, 100, al_map_rgba_f(0.2, 0.2, 0, 1), Thickness); - - al_draw_ellipse(0, 0, 300, 150, al_map_rgba_f(0, 0.5, 0.5, 1), Thickness); - al_draw_arc(0, 0, 200, -ALLEGRO_PI / 2, ALLEGRO_PI, al_map_rgba_f(0.5, 0.25, 0, 1), Thickness); - al_draw_spline(points, al_map_rgba_f(0.1, 0.2, 0.5, 1), Thickness); - - al_use_transform(&Identity); - } -} - -static void HighFilledPrimitives(Mode: TMODE) -{ - if (mode == INIT) { - - } else if (mode == LOGIC) { - Theta += Speed; - al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); - } else if (mode == DRAW) { - if (Blend) - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - else - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - - al_use_transform(&MainTrans); - - al_draw_filled_triangle(-100, -100, -150, 200, 100, 200, al_map_rgb_f(0.5, 0.7, 0.3)); - al_draw_filled_rectangle(20, -50, 200, 50, al_map_rgb_f(0.3, 0.2, 0.6)); - al_draw_filled_ellipse(-250, 0, 100, 150, al_map_rgb_f(0.3, 0.3, 0.3)); - al_draw_filled_rounded_rectangle(50, -250, 350, -75, 50, 70, al_map_rgba_f(0.2, 0.2, 0, 1)); - - al_use_transform(&Identity); - } -} - -static void TransformationsPrimitives(Mode: TMODE) -{ - float t = al_get_time(); - if (mode == INIT) { - - } else if (mode == LOGIC) { - Theta += Speed; - al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, sinf(t / 5), cosf(t / 5), Theta); - } else if (mode == DRAW) { - float points[8] = { - -300, -200, - 700, 200, - -700, 200, - 300, -200 - }; - - if (Blend) - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - else - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - - al_use_transform(&MainTrans); - - al_draw_line(-300, -200, 300, 200, al_map_rgba_f(0, 0.5, 0.5, 1), Thickness); - al_draw_triangle(-150, -250, 0, 250, 150, -250, al_map_rgba_f(0.5, 0, 0.5, 1), Thickness); - al_draw_rectangle(-300, -200, 300, 200, al_map_rgba_f(0.5, 0, 0, 1), Thickness); - al_draw_rounded_rectangle(-200, -125, 200, 125, 50, 100, al_map_rgba_f(0.2, 0.2, 0, 1), Thickness); - - al_draw_ellipse(0, 0, 300, 150, al_map_rgba_f(0, 0.5, 0.5, 1), Thickness); - al_draw_arc(0, 0, 200, -ALLEGRO_PI / 2, ALLEGRO_PI, al_map_rgba_f(0.5, 0.25, 0, 1), Thickness); - al_draw_spline(points, al_map_rgba_f(0.1, 0.2, 0.5, 1), Thickness); - - al_use_transform(&Identity); - } -} - -static void LowPrimitives(Mode: TMODE) -{ - static ALLEGRO_VERTEX vtx[13]; - static ALLEGRO_VERTEX vtx2[13]; - if (mode == INIT) { - int Ndx = 0; - ALLEGRO_COLOR color; - for (Ndx = 0; Ndx < 13; Ndx++) { - float x, y; - x = 200 * cosf((float)Ndx / 13.0f * 2 * ALLEGRO_PI); - y = 200 * sinf((float)Ndx / 13.0f * 2 * ALLEGRO_PI); - - color = al_map_rgb((Ndx + 1) % 3 * 64, (Ndx + 2) % 3 * 64, (Ndx) % 3 * 64); - - vtx[Ndx].x = x; vtx[Ndx].y = y; vtx[Ndx].z = 0; - vtx2[Ndx].x = 0.1 * x; vtx2[Ndx].y = 0.1 * y; - vtx[Ndx].color = color; - vtx2[Ndx].color = color; - } - } else if (mode == LOGIC) { - Theta += Speed; - al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); - } else if (mode == DRAW) { - if (Blend) - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - else - al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - - al_use_transform(&MainTrans); - - al_draw_prim(vtx, 0, 0, 0, 4, ALLEGRO_PRIM_LINE_LIST); - al_draw_prim(vtx, 0, 0, 4, 9, ALLEGRO_PRIM_LINE_STRIP); - al_draw_prim(vtx, 0, 0, 9, 13, ALLEGRO_PRIM_LINE_LOOP); - al_draw_prim(vtx2, 0, 0, 0, 13, ALLEGRO_PRIM_POINT_LIST); - - al_use_transform(&Identity); - } -} - - *) - - - PROCEDURE IndexedPrimitives (Mode: TMODE); - VAR - Indices1: ARRAY [0..3] OF LONGINT = (0, 1, 3, 4); - Indices2: ARRAY [0..3] OF LONGINT = (5, 6, 7, 8); - Indices3: ARRAY [0..3] OF LONGINT = (9, 10, 11, 12); - vtx, vtx2 : ARRAY [0..12] OF ALLEGRO_VERTEX; - Ndx, x, y: INTEGER; - Color: ALLEGRO_COLOR; - BEGIN - CASE Mode OF - INIT: - FOR Ndx := LOW (vtx) TO HIGH (vtx) DO - BEGIN - x := TRUNC (200 * cos (Ndx / 13 * 2 * ALLEGRO_PI)); - y := TRUNC (200 * sin (Ndx / 13 * 2 * ALLEGRO_PI)); - Color := al_map_rgb ((Ndx + 1) MOD 3 * 64, (2 * Ndx + 2) MOD 3 * 64, Ndx MOD 3 * 64); - vtx[Ndx].x := x; vtx[Ndx].y := y; vtx[Ndx].z := 0; - vtx2[Ndx].x := 0.1 * x; vtx2[Ndx].y := 0.1 * y; - vtx[Ndx].color := Color; - vtx2[Ndx].color := Color; - END; - LOGIC: - BEGIN - Theta := Theta + Speed; - FOR Ndx := LOW (Indices1) TO HIGH (Indices1) DO - BEGIN - indices1[Ndx] := TRUNC (al_get_time + Ndx) MOD 13; - indices2[Ndx] := TRUNC (al_get_time + Ndx + 4) MOD 13; - indices3[Ndx] := TRUNC (al_get_time + Ndx + 8) MOD 13; - END; - al_build_transform (MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); - END; - DRAW: - BEGIN - IF Blend THEN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE) - ELSE - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_use_transform (MainTrans); - al_draw_indexed_prim (@vtx[0], NIL, NIL, Indices1, 4, ALLEGRO_PRIM_LINE_LIST); - al_draw_indexed_prim (@vtx[0], NIL, NIL, Indices2, 4, ALLEGRO_PRIM_LINE_STRIP); - al_draw_indexed_prim (@vtx[0], NIL, NIL, Indices3, 4, ALLEGRO_PRIM_LINE_LOOP); - al_draw_indexed_prim (@vtx2[0], NIL, NIL, Indices3, 4, ALLEGRO_PRIM_POINT_LIST); - al_use_transform (Identity); - END; - END; - END; - - - - -VAR - Display: ALLEGRO_DISPLAYptr; - Bkg: ALLEGRO_BITMAPptr; - White, Black: ALLEGRO_COLOR; - Queue, TimerQueue: ALLEGRO_EVENT_QUEUEptr; - RefreshRate, FramesDone: INTEGER; - TimeDiff, FixedTimestep, RealTime, GameTime: SINGLE; - Ndx, CurScreen: INTEGER; - Done, Clip: BOOLEAN; - Old: INTEGER; - Timer: ALLEGRO_TIMERptr; - FrameDuration, StartTime: SINGLE; - KeyEvent: ALLEGRO_EVENT; - - - - PROCEDURE NextScreen; - BEGIN - REPEAT - INC (CurScreen); - IF CurScreen > HIGH (Screens) THEN - CurScreen := LOW (Screens); - UNTIL Screens[CurScreen] <> NIL; - END; - - PROCEDURE PrevScreen; - BEGIN - REPEAT - DEC (CurScreen); - IF CurScreen < LOW (Screens) THEN - CurScreen := HIGH (Screens); - UNTIL Screens[CurScreen] <> NIL; - END; - -BEGIN -{ Initialize Allegro 5 and addons } - IF NOT al_init THEN - AbortExample ('Could not init Allegro.'); - al_init_image_addon; - al_init_font_addon; - al_init_primitives_addon; -{ Create a window to display things on: 640x480 pixels } - Display := al_create_display (ScreenW, ScreenH); - IF Display = NIL THEN - AbortExample ('Error creating display.'); -{ Install input handler } - IF NOT al_install_keyboard THEN - AbortExample ('Error installing keyboard.'); - IF NOT al_install_mouse THEN - AbortExample ('Error installing mouse.'); -{ Load resources } - Font := al_load_font ('data/fixed_font.tga', 0, 0); - IF Font = NIL THEN - AbortExample ('Error loading "data/fixed_font.tga"'); - SolidWhite := al_map_rgba_f (1, 1, 1, 1); - Bkg := al_load_bitmap ('data/bkg.png'); - Texture := al_load_bitmap ('data/texture.tga'); - IF Texture = NIL THEN - AbortExample ('Error loading "data/texture.tga"'); -{ Make and set some color to draw with } - White := al_map_rgba_f (1.0, 1.0, 1.0, 1.0); - Black := al_map_rgba_f (0.0, 0.0, 0.0, 1.0); -{ Start the event queue to handle input } - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_keyboard_event_source); - al_register_event_source (Queue, al_get_display_event_source (Display)); - al_register_event_source (Queue, al_get_mouse_event_source); - al_set_window_title (Display, 'Primitives Example'); - - RefreshRate := 60; - FramesDone := 0; - TimeDiff := al_get_time; - FixedTimestep := 1 / RefreshRate; - RealTime := al_get_time; - GameTime := al_get_time; - CurScreen := 2; { LOW (Screens); } - Done := FALSE; - Clip := FALSE; - - timer := al_create_timer (ALLEGRO_BPS_TO_SECS (RefreshRate)); - al_start_timer (Timer); - TimerQueue := al_create_event_queue; - al_register_event_source (TimerQueue, al_get_timer_event_source (Timer)); - - Old := al_get_new_bitmap_flags; - al_set_new_bitmap_flags (ALLEGRO_MEMORY_BITMAP); - Buffer := al_create_bitmap (ScreenW, ScreenH); - al_set_new_bitmap_flags (Old); - - al_identity_transform (Identity); - - Screens[1] := NIL; { @LowPrimitives; } - Screens[2] := @IndexedPrimitives; - Screens[3] := NIL; { @HighPrimitives; } - Screens[4] := NIL; { @TransformationsPrimitives; } - Screens[5] := @FilledPrimitives; - Screens[6] := NIL; { @IndexedFilledPrimitives; } - Screens[7] := NIL; { @HighFilledPrimitives; } - Screens[8] := @TexturePrimitives; - Screens[9] := @FilledTexturePrimitives; - Screens[10] := @CustomVertexFormatPrimitives; - - ScreenName[1] := 'Low Level Primitives'; - ScreenName[2] := 'Indexed Primitives'; - ScreenName[3] := 'High Level Primitives'; - ScreenName[4] := 'Transformations'; - ScreenName[5] := 'Low Level Filled Primitives'; - ScreenName[6] := 'Indexed Filled Primitives'; - ScreenName[7] := 'High Level Filled Primitives'; - ScreenName[8] := 'Textured Primitives'; - ScreenName[9] := 'Filled Textured Primitives'; - ScreenName[10] := 'Custom Vertex Format'; - - FOR Ndx := LOW (Screens) TO HIGH (Screens) DO - IF Screens[Ndx] <> NIL THEN - Screens[Ndx] (INIT); - REPEAT - FrameDuration := al_get_time - RealTime; - al_rest (FixedTimestep - FrameDuration); { rest at least fixed_dt } - FrameDuration := al_get_time - RealTime; - RealTime := al_get_time; - IF RealTime - GameTime > FrameDuration THEN { eliminate excess overflow } - BEGIN - GameTime := GameTime + FixedTimestep * TRUNC ((RealTime - GameTime) / FixedTimestep); - WHILE RealTime - GameTime >= 0 DO - BEGIN - StartTime := al_get_time; - GameTime := GameTime + FixedTimestep; - Screens[CurScreen](LOGIC); - WHILE al_get_next_event (Queue, KeyEvent) DO - BEGIN - CASE (KeyEvent._type) OF - ALLEGRO_EVENT_MOUSE_BUTTON_DOWN: - NextScreen; - ALLEGRO_EVENT_DISPLAY_CLOSE: - Done := TRUE; - ALLEGRO_EVENT_KEY_CHAR: - CASE KeyEvent.keyboard.keycode OF - ALLEGRO_KEY_ESCAPE: - Done := TRUE; - ALLEGRO_KEY_S: - BEGIN - Soft := NOT Soft; - TimeDiff := al_get_time; - FramesDone := 0; - END; - ALLEGRO_KEY_C: - BEGIN - Clip := NOT Clip; - TimeDiff := al_get_time; - FramesDone := 0; - END; - ALLEGRO_KEY_L: - BEGIN - Blend := NOT Blend; - TimeDiff := al_get_time; - FramesDone := 0; - END; - ALLEGRO_KEY_B: - BEGIN - Background := NOT Background; - TimeDiff := al_get_time; - FramesDone := 0; - END; - ALLEGRO_KEY_LEFT: - Speed := Speed - ROTATE_SPEED; - ALLEGRO_KEY_RIGHT: - Speed := Speed + ROTATE_SPEED; - ALLEGRO_KEY_PGUP: - BEGIN - Thickness := Thickness + 0.5; - IF Thickness < 1 THEN - Thickness := 1; - END; - ALLEGRO_KEY_PGDN: - BEGIN - Thickness := Thickness - 0.5; - IF Thickness < 1 THEN - Thickness := 0; - END; - ALLEGRO_KEY_UP: - NextScreen; - ALLEGRO_KEY_SPACE: - Speed := 0; - ALLEGRO_KEY_DOWN: - PrevScreen; - END; - END; - END; - IF al_get_time - StartTime > FixedTimestep THEN { break if we start taking too long } - RealTime := GameTime; - END; - al_clear_to_color (Black); - IF Soft THEN - BEGIN - al_set_target_bitmap (Buffer); - al_clear_to_color (Black); - END; - IF Background AND (Bkg <> NIL) THEN - BEGIN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_draw_scaled_bitmap (Bkg, 0, 0, al_get_bitmap_width (Bkg), al_get_bitmap_height (Bkg), 0, 0, ScreenW, ScreenH, 0); - END; - IF Clip THEN - al_set_clipping_rectangle (ScreenW DIV 2, ScreenH DIV 2, ScreenW DIV 2, ScreenH DIV 2); - Screens[CurScreen] (DRAW); - al_set_clipping_rectangle (0, 0, ScreenW, ScreenH); - IF Soft THEN - BEGIN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_set_target_backbuffer (Display); - al_draw_bitmap (Buffer, 0, 0, 0); - END; - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA); - al_draw_text (Font, SolidWhite, ScreenW DIV 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, '('+IntToStr (CurScreen)+') '+ScreenName[CurScreen]); - al_draw_text (Font, SolidWhite, 0, 0, 0, 'FPS: '+ FloatToStr (FramesDone / (al_get_time - TimeDiff))); - al_draw_text (Font, SolidWhite, 0, 20, 0, 'Change Screen (Up/Down). Esc to Quit.'); - al_draw_text (Font, SolidWhite, 0, 40, 0, 'Rotation (Left/Right/Space): '+ FloatToStr (Speed)); - al_draw_text (Font, SolidWhite, 0, 60, 0, 'Thickness (PgUp/PgDown): '+ FloatToStr (Thickness)); - al_draw_text (Font, SolidWhite, 0, 80, 0, 'Software (S): '+ BoolToStr (Soft)); - al_draw_text (Font, SolidWhite, 0, 100, 0, 'Blending (L): '+ BoolToStr (Blend)); - al_draw_text (Font, SolidWhite, 0, 120, 0, 'Background (B): '+ BoolToStr (Background)); - al_draw_text (Font, SolidWhite, 0, 140, 0, 'Clip (C): '+ BoolToStr (Clip)); - - al_flip_display; - INC (FramesDone); - END; - UNTIL Done; -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_rotate.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_rotate.pas deleted file mode 100644 index 9401c828..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_rotate.pas +++ /dev/null @@ -1,174 +0,0 @@ -PROGRAM ex_rotate; -(* - * Example program for the Allegro library, by Peter Wang. - *) -USES - common, - Allegro5, - al5image; - - CONST - DisplayW = 640; - DisplayH = 480; - - VAR - Display: ALLEGRO_DISPLAYptr; - Buf, Bmp, MemBmp, SrcBmp: ALLEGRO_BITMAPptr; - BmpW, BmpH: INTEGER; - Queue: ALLEGRO_EVENT_QUEUEptr; - Event: ALLEGRO_EVENT; - Theta, K: SINGLE; - Mode, Flags: INTEGER; - WideMode, MemSrcMode, TransMode, ClipMode: BOOLEAN; - Trans: ALLEGRO_COLOR; - EndLoop: BOOLEAN; - -BEGIN - Theta := 0; - K := 1; - Mode := 0; - WideMode := FALSE; - MemSrcMode := FALSE; - TransMode := FALSE; - Flags := 0; - ClipMode := FALSE; - - IF NOT al_init THEN - AbortExample ('Could not init Allegro'); - - al_install_keyboard; - al_init_image_addon; - - OpenLog; - LogWriteLn ('Press ''w'' to toggle wide mode.'); - LogWriteLn ('Press ''s'' to toggle memory source bitmap.'); - LogWriteLn ('Press space to toggle drawing to backbuffer or off-screen bitmap.'); - LogWriteLn ('Press ''t'' to toggle translucency.'); - LogWriteLn ('Press ''h'' to toggle horizontal flipping.'); - LogWriteLn ('Press ''v'' to toggle vertical flipping.'); - LogWriteLn ('Press ''c'' to toggle clipping.'); - LogWriteLn (''); - - Display := al_create_display (DisplayW, DisplayH); - IF Display = NIL THEN - AbortExample ('Error creating display'); - - Buf := al_create_bitmap (DisplayW, DisplayH); - IF Buf = NIL THEN - AbortExample ('Unable to create buffer'); - - Bmp := al_load_bitmap ('data/mysha.pcx'); - IF Bmp = NIL THEN - AbortExample ('Unable to load image'); - - al_set_new_bitmap_flags (ALLEGRO_MEMORY_BITMAP); - MemBmp := al_load_bitmap ('data/mysha.pcx'); - IF MemBmp = NIL THEN - AbortExample ('Unable to load image'); - - BmpW := al_get_bitmap_width (Bmp); - BmpH := al_get_bitmap_height (Bmp); - - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_keyboard_event_source); - - EndLoop := FALSE; - REPEAT - IF al_get_next_event (Queue, Event) THEN - BEGIN - IF Event._type = ALLEGRO_EVENT_KEY_CHAR THEN - BEGIN - IF Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE THEN - EndLoop := TRUE; - IF Event.keyboard.unichar = ORD (' ') THEN - BEGIN - mode := 1 - mode; - IF Mode = 0 THEN - LogWriteLn ('Drawing to off-screen buffer') - ELSE - LogWriteLn ('Drawing to display backbuffer'); - END; - IF Event.keyboard.unichar = ORD ('w') THEN - WideMode := NOT WideMode; - IF Event.keyboard.unichar = ORD ('s') THEN - BEGIN - MemSrcMode := NOT MemSrcMode; - IF MemSrcMode THEN - LogWriteLn ('Source is memory bitmap') - ELSE - LogWriteLn ('Source is display bitmap'); - END; - IF Event.keyboard.unichar = ORD ('t') THEN - TransMode := NOT transmode; - IF Event.keyboard.unichar = ORD ('h') THEN - Flags := Flags XOR ALLEGRO_FLIP_HORIZONTAL; - IF Event.keyboard.unichar = ORD ('v') THEN - Flags := Flags XOR ALLEGRO_FLIP_VERTICAL; - IF Event.keyboard.unichar = ORD ('c') THEN - ClipMode := NOT ClipMode; - END; - END; - (* - * mode 0 = draw scaled to off-screen buffer before - * blitting to display backbuffer - * mode 1 = draw scaled to display backbuffer - *) - - IF Mode = 0 THEN - al_set_target_bitmap (Buf) - ELSE - al_set_target_backbuffer (Display); - - IF MemSrcMode THEN - SrcBmp := MemBmp - ELSE - SrcBmp := Bmp; - IF WideMode THEN - K := 2 - ELSE - K := 1; - - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - Trans := al_map_rgba_f (1, 1, 1, 1); - IF Mode = 0 THEN - al_clear_to_color (al_map_rgba_f (1, 0, 0, 1)) - ELSE - al_clear_to_color (al_map_rgba_f (0, 0, 1, 1)); - - IF TransMode THEN - BEGIN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA); - Trans := al_map_rgba_f (1, 1, 1, 0.5); - END; - - IF ClipMode THEN - al_set_clipping_rectangle (50, 50, DisplayW - 100, DisplayH - 100) - ELSE - al_set_clipping_rectangle (0, 0, DisplayW, DisplayH); - - al_draw_tinted_scaled_rotated_bitmap (SrcBmp, - Trans, - 50, 50, DisplayW DIV 2, DisplayH DIV 2, - K, K, Theta, - Flags); - - IF Mode = 0 THEN - BEGIN - al_set_target_backbuffer (Display); - al_set_clipping_rectangle (0, 0, DisplayW, DisplayH); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_draw_bitmap (Buf, 0, 0, 0); - END; - - al_flip_display; - al_rest (0.01); - Theta := Theta - 0.01; - UNTIL EndLoop; - al_destroy_bitmap (Bmp); - al_destroy_bitmap (MemBmp); - al_destroy_bitmap (Buf); - - CloseLog (FALSE); -END. - -/* vim: set sts=3 sw=3 et: */ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_scale.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_scale.pas deleted file mode 100644 index 37192757..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_scale.pas +++ /dev/null @@ -1,178 +0,0 @@ -PROGRAM ex_scale; -(* - * Example program for the Allegro library, by Peter Wang. - *) - -USES - common, - Allegro5, - al5image; - - CONST - DisplayW = 640; - DisplayH = 480; - - VAR - Display: ALLEGRO_DISPLAYptr; - Buf, Bmp, MemBmp, SrcBmp: ALLEGRO_BITMAPptr; - BmpW, BmpH: INTEGER; - Queue: ALLEGRO_EVENT_QUEUEptr; - Event: ALLEGRO_EVENT; - Theta, K: SINGLE; - Mode, Flags: INTEGER; - WideMode, MemSrcMode, TransMode, ClipMode: BOOLEAN; - Tint: ALLEGRO_COLOR; - EndLoop: BOOLEAN; - -BEGIN - Theta := 0; - K := 1; - Mode := 0; - WideMode := FALSE; - MemSrcMode := FALSE; - TransMode := FALSE; - Flags := 0; - ClipMode := FALSE; - - IF NOT al_init THEN - AbortExample ('Could not init Allegro'); - - al_install_keyboard; - al_init_image_addon; - - OpenLog; - LogWriteLn ('Press ''w'' to toggle wide mode.'); - LogWriteLn ('Press ''s'' to toggle memory source bitmap.'); - LogWriteLn ('Press space to toggle drawing to backbuffer or off-screen bitmap.'); - LogWriteLn ('Press ''t'' to toggle translucency.'); - LogWriteLn ('Press ''h'' to toggle horizontal flipping.'); - LogWriteLn ('Press ''v'' to toggle vertical flipping.'); - LogWriteLn ('Press ''c'' to toggle clipping.'); - LogWriteLn (''); - - Display := al_create_display (DisplayW, DisplayH); - IF Display = NIL THEN - AbortExample ('Error creating display'); - - Buf := al_create_bitmap (DisplayW, DisplayH); - IF Buf = NIL THEN - AbortExample ('Unable to create buffer'); - - Bmp := al_load_bitmap ('data/mysha.pcx'); - IF Bmp = NIL THEN - AbortExample ('Unable to load image'); - - al_set_new_bitmap_flags (ALLEGRO_MEMORY_BITMAP); - MemBmp := al_load_bitmap ('data/mysha.pcx'); - IF MemBmp = NIL THEN - AbortExample ('Unable to load image'); - - BmpW := al_get_bitmap_width (Bmp); - BmpH := al_get_bitmap_height (Bmp); - - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_keyboard_event_source); - - EndLoop := FALSE; - REPEAT - IF al_get_next_event (Queue, Event) THEN - BEGIN - IF Event._type = ALLEGRO_EVENT_KEY_CHAR THEN - BEGIN - IF Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE THEN - EndLoop := TRUE; - IF Event.keyboard.unichar = ORD (' ') THEN - BEGIN - mode := 1 - mode; - IF Mode = 0 THEN - LogWriteLn ('Drawing to off-screen buffer') - ELSE - LogWriteLn ('Drawing to display backbuffer'); - END; - IF Event.keyboard.unichar = ORD ('w') THEN - WideMode := NOT WideMode; - IF Event.keyboard.unichar = ORD ('s') THEN - BEGIN - MemSrcMode := NOT MemSrcMode; - IF MemSrcMode THEN - LogWriteLn ('Source is memory bitmap') - ELSE - LogWriteLn ('Source is display bitmap'); - END; - IF Event.keyboard.unichar = ORD ('t') THEN - TransMode := NOT transmode; - IF Event.keyboard.unichar = ORD ('h') THEN - Flags := Flags XOR ALLEGRO_FLIP_HORIZONTAL; - IF Event.keyboard.unichar = ORD ('v') THEN - Flags := Flags XOR ALLEGRO_FLIP_VERTICAL; - IF Event.keyboard.unichar = ORD ('c') THEN - ClipMode := NOT ClipMode; - END; - END; - - (* - * mode 0 = draw scaled to off-screen buffer before - * blitting to display backbuffer - * mode 1 = draw scaled to display backbuffer - *) - - IF Mode = 0 THEN - al_set_target_bitmap (Buf) - ELSE - al_set_target_backbuffer (Display); - - IF MemSrcMode THEN - SrcBmp := MemBmp - ELSE - SrcBmp := Bmp; - IF WideMode THEN - K := 2 - ELSE - K := 1; - - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - Tint := al_map_rgba_f (1, 1, 1, 1); - IF Mode = 0 THEN - al_clear_to_color (al_map_rgba_f (1, 0, 0, 1)) - ELSE - al_clear_to_color (al_map_rgba_f (0, 0, 1, 1)); - - IF TransMode THEN - BEGIN - al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA); - Tint := al_map_rgba_f (1, 1, 1, 0.5); - END; - - IF ClipMode THEN - al_set_clipping_rectangle (50, 50, DisplayW - 100, DisplayH - 100) - ELSE - al_set_clipping_rectangle (0, 0, DisplayW, DisplayH); - - al_draw_tinted_scaled_bitmap (SrcBmp, - Tint, - 0, 0, BmpW, BmpH, - DisplayW DIV 2, DisplayH DIV 2, - TRUNC (K * cos (Theta) * DisplayW) DIV 2, TRUNC (k * sin (Theta) * DisplayH) DIV 2, - Flags); - - IF Mode = 0 THEN - BEGIN - al_set_target_backbuffer (Display); - al_set_clipping_rectangle (0, 0, DisplayW, DisplayH); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - al_draw_bitmap (Buf, 0, 0, 0); - END; - - al_flip_display; - al_rest (0.01); - Theta := Theta + 0.01; - UNTIL EndLoop; - - al_destroy_bitmap (Bmp); - al_destroy_bitmap (MemBmp); - al_destroy_bitmap (Buf); - - CloseLog (FALSE); -END. - -/* vim: set sts=3 sw=3 et: */ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_transform.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_transform.pas deleted file mode 100644 index 0f710c41..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_transform.pas +++ /dev/null @@ -1,193 +0,0 @@ -PROGRAM ex_transform; - - USES - common, - Allegro5, al5image, al5font, al5primitives; - - VAR - Filename: STRING; - Display: ALLEGRO_DISPLAYptr; - Buffer, Bitmap, Subbitmap, BufferSubbitmap, Overlay: ALLEGRO_BITMAPptr; - Timer: ALLEGRO_TIMERptr; - Queue: ALLEGRO_EVENT_QUEUEptr; - Event: ALLEGRO_EVENT; - Transform, Identity: ALLEGRO_TRANSFORM; - Software, Redraw, Blend, UseSubbitmap, EndLoop: BOOLEAN; - w, h: INTEGER; - Font, SoftFont: ALLEGRO_FONTptr; - t: SINGLE; - Tint: ALLEGRO_COLOR; -BEGIN - Software := FALSE; - Redraw := FALSE; - Blend := FALSE; - UseSubbitmap := FALSE; - - IF Paramcount > 1 THEN - Filename := ParamStr (1) - ELSE - Filename := 'data/mysha.pcx'; - - IF NOT al_init THEN - AbortExample ('Could not init Allegro.\n'); - - al_init_primitives_addon; - al_install_mouse; - al_install_keyboard; - - al_init_image_addon; - al_init_font_addon; - - Display := al_create_display (640, 480); - IF Display = NIL THEN - AbortExample ('Error creating display'); - - Subbitmap := al_create_sub_bitmap (al_get_backbuffer (Display), 50, 50, 640 - 50, 480 - 50); - Overlay := al_create_sub_bitmap (al_get_backbuffer (Display), 100, 100, 300, 50); - - al_set_window_title (Display, Filename); - - Bitmap := al_load_bitmap (Filename); - IF Bitmap = NIL THEN - AbortExample (Filename + ' not found or failed to load'); - Font := al_load_font ('data/bmpfont.tga', 0, 0); - IF Font = NIL THEN - AbortExample ('data/bmpfont.tga not found or failed to load'); - - al_set_new_bitmap_flags (ALLEGRO_MEMORY_BITMAP); - Buffer := al_create_bitmap (640, 480); - BufferSubbitmap := al_create_sub_bitmap (Buffer, 50, 50, 640 - 50, 480 - 50); - - SoftFont := al_load_font ('data/bmpfont.tga', 0, 0); - IF SoftFont = NIL THEN - AbortExample ('data/bmpfont.tga not found or failed to load\n'); - - Timer := al_create_timer (1 / 60); - Queue := al_create_event_queue; - al_register_event_source (Queue, al_get_keyboard_event_source); - al_register_event_source (Queue, al_get_display_event_source (Display)); - al_register_event_source (Queue, al_get_timer_event_source (Timer)); - al_start_timer (Timer); - - w := al_get_bitmap_width (Bitmap); - h := al_get_bitmap_height (Bitmap); - - al_set_target_bitmap (Overlay); - al_identity_transform (Transform); - al_rotate_transform (Transform, -0.06); - al_use_transform ( &transform); - - EndLoop := FALSE; - REPEAT - al_wait_for_event (Queue, Event); - CASE Event._type OF - ALLEGRO_EVENT_DISPLAY_CLOSE: - EndLoop := TRUE; - ALLEGRO_EVENT_KEY_DOWN: - CASE Event.keyboard.keycode OF - ALLEGRO_KEY_S: - BEGIN - Software := NOT Software; - IF Software THEN - BEGIN - { Restore identity transform on display bitmap. } - al_identity_transform (Identity); - al_use_transform (Identity); - END; - END; - ALLEGRO_KEY_L: - Blend := NOT Blend; - ALLEGRO_KEY_B: - UseSubbitmap := NOT UseSubbitmap; - ALLEGRO_KEY_ESCAPE: - EndLoop := TRUE; - END; - ALLEGRO_EVENT_TIMER: - Redraw := TRUE; - END; - - IF Redraw AND al_is_event_queue_empty (Queue) THEN - BEGIN - t := 3 + al_get_time; - Redraw := FALSE; - - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - IF Blend THEN - Tint := al_map_rgba_f (0.5, 0.5, 0.5, 0.5) - ELSE - Tint := al_map_rgba_f (1, 1, 1, 1); - - IF Software THEN - BEGIN - al_set_target_bitmap (Buffer); - IF UseSubbitmap THEN - BEGIN - al_clear_to_color (al_map_rgb_f (1, 0, 0)); - al_set_target_bitmap (BufferSubbitmap); - END; - END - ELSE BEGIN - al_set_target_backbuffer (Display); - IF UseSubbitmap THEN - BEGIN; - al_clear_to_color (al_map_rgb_f (1, 0, 0)); - al_set_target_bitmap (Subbitmap); - END; - END; - - { Set the transformation on the target bitmap. } - al_identity_transform (Transform); - al_translate_transform (Transform, -640 / 2, -480 / 2); - al_scale_transform (Transform, 0.15 + sin (t / 5), 0.15 + cos (t / 5)); - al_rotate_transform (Transform, t / 50); - al_translate_transform (Transform, 640 / 2, 480 / 2); - al_use_transform (Transform); - - { Draw some stuff. } - al_clear_to_color (al_map_rgb_f (0, 0, 0)); - al_draw_tinted_bitmap (Bitmap, Tint, 0, 0, 0); - al_draw_tinted_scaled_bitmap (Bitmap, Tint, w / 4, h / 4, w / 2, h / 2, w, 0, w / 2, h / 4, 0); - al_draw_tinted_bitmap_region (Bitmap, Tint, w / 4, h / 4, w / 2, h / 2, 0, h, ALLEGRO_FLIP_VERTICAL); - al_draw_tinted_scaled_rotated_bitmap (Bitmap, Tint, w / 2, h / 2, w + w / 2, h + h / 2, 0.7, 0.7, 0.3, 0); - al_draw_pixel (w + w / 2, h + h / 2, al_map_rgb_f (0, 1, 0)); - al_put_pixel (w + w DIV 2 + 2, h + h DIV 2 + 2, al_map_rgb_f (0, 1, 1)); - al_draw_circle (w, h, 50, al_map_rgb_f (1, 0.5, 0), 3); - - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); - IF Software THEN - BEGIN - al_draw_text (SoftFont, al_map_rgba_f (1, 1, 1, 1), - 640 / 2, 430, ALLEGRO_ALIGN_CENTRE, 'Software Rendering' - ); - al_set_target_backbuffer (Display); - al_draw_bitmap (Buffer, 0, 0, 0); - END - ELSE - al_draw_text (Font, al_map_rgba_f (1, 1, 1, 1), - 640 / 2, 430, ALLEGRO_ALIGN_CENTRE, 'Hardware Rendering' - ); - - { Each target bitmap has its own transformation matrix, so this - overlay is unaffected by the transformations set earlier. } - al_set_target_bitmap (Overlay); - al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); - al_draw_text (Font, al_map_rgba_f (1, 1, 0, 1), - 0, 10, ALLEGRO_ALIGN_LEFT, 'hello!' - ); - - al_set_target_backbuffer (Display); - al_flip_display; - END; - UNTIL EndLoop; - - al_destroy_event_queue (Queue); - al_destroy_timer (Timer); - al_destroy_font (SoftFont); - al_destroy_bitmap (BufferSubbitmap); - al_destroy_bitmap (Buffer); - al_destroy_font (Font); - al_destroy_bitmap (Bitmap); - al_destroy_bitmap (Overlay); - al_destroy_bitmap (Subbitmap); - al_destroy_display (Display); -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_warp_mouse.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_warp_mouse.pas deleted file mode 100644 index 9dc4ce08..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/ex_warp_mouse.pas +++ /dev/null @@ -1,142 +0,0 @@ -PROGRAM ex_warp_mouse; -(* Copyright (c) 2012 Guillermo Martínez J. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - *) - - USES - common, - Allegro5, al5font, al5image, al5primitives, - sysutils; - - CONST - Width = 640; - Height = 480; - - VAR - Font: ALLEGRO_FONTptr; - Display: ALLEGRO_DISPLAYptr; - EventQueue: ALLEGRO_EVENT_QUEUEptr; - Event: ALLEGRO_EVENT; - EndLoop, RightButtonDown, Redraw: BOOLEAN; - FakeX, FakeY, th: INTEGER; - White, Black, Red: ALLEGRO_COLOR; - -BEGIN - RightButtonDown := FALSE; - Redraw := TRUE; - FakeX := 0; FakeY := 0; - - IF NOT al_init THEN - AbortExample ('Could not init Allegro.'); - al_init_primitives_addon; - al_init_font_addon; - al_init_image_addon; - al_install_mouse; - al_install_keyboard; - - al_set_new_display_flags (ALLEGRO_WINDOWED); - Display := al_create_display (Width, Height); - IF Display = NIL THEN - AbortExample ('Could not create display.'); - - EventQueue := al_create_event_queue; - al_register_event_source (EventQueue, al_get_display_event_source (Display)); - al_register_event_source (EventQueue, al_get_mouse_event_source); - al_register_event_source (EventQueue, al_get_keyboard_event_source); - - Font := al_load_font ('data/fixed_font.tga', 0, 0); - White := al_map_rgb_f (1, 1, 1); - Black := al_map_rgb_f (0, 0, 0); - Red := al_map_rgb_f (1, 0, 0); - - EndLoop := FALSE; - REPEAT - al_get_next_event (EventQueue, Event); - IF Redraw AND al_is_event_queue_empty (EventQueue) THEN - BEGIN - th := al_get_font_line_height (Font); - - al_clear_to_color (Black); - - IF RightButtonDown THEN - BEGIN - al_draw_line (Width DIV 2, Height DIV 2, FakeX, FakeY, Red, 1); - al_draw_line (FakeX - 5, FakeY, FakeX + 5, FakeY, White, 2); - al_draw_line (FakeX, FakeY - 5, FakeX, FakeY + 5, White, 2); - END; - - al_draw_text (Font, White, 0, 0, 0, - Format ('x: %d y: %d dx: %d dy %d', - [event.mouse.x, event.mouse.y, event.mouse.dx, event.mouse.dy] - ) - ); - al_draw_text (Font, White, Width DIV 2, Height DIV 2 - th, - ALLEGRO_ALIGN_CENTRE, 'Left-Click to warp pointer to the middle once.' - ); - al_draw_text (Font, White, Width DIV 2, Height DIV 2, - ALLEGRO_ALIGN_CENTRE, - 'Hold right mouse button to constantly move pointer to the middle.' - ); - al_flip_display; - Redraw := FALSE; - END; - - al_wait_for_event (EventQueue, Event); - CASE Event._type OF - ALLEGRO_EVENT_DISPLAY_CLOSE: - EndLoop := TRUE; - ALLEGRO_EVENT_KEY_DOWN: - IF Event.keyboard.keycode = ALLEGRO_KEY_ESCAPE THEN - EndLoop := TRUE; - ALLEGRO_EVENT_MOUSE_WARPED: { ??? } - { WriteLn ('Warp') }; - ALLEGRO_EVENT_MOUSE_AXES: - BEGIN - IF RightButtonDown THEN - BEGIN - al_set_mouse_xy (Display, Width DIV 2, Height DIV 2); - INC (FakeX, Event.mouse.dx); - INC (FakeY, Event.mouse.dy); - END; - Redraw := TRUE; - END; - ALLEGRO_EVENT_MOUSE_BUTTON_DOWN: - BEGIN - IF Event.mouse.button = 1 THEN - al_set_mouse_xy (Display, Width DIV 2, Height DIV 2); - IF Event.mouse.button = 2 THEN - BEGIN - RightButtonDown := TRUE; - FakeX := Width DIV 2; - FakeY := Height DIV 2; - END; - Redraw := TRUE; - END; - ALLEGRO_EVENT_MOUSE_BUTTON_UP: - IF Event.mouse.button = 2 THEN - RightButtonDown := FALSE; - END; - UNTIL EndLoop; - - al_destroy_font (Font); - al_destroy_event_queue(EventQueue); - al_destroy_display (Display); -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/test.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/test.pas deleted file mode 100644 index f4e38f21..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/examples/test.pas +++ /dev/null @@ -1,85 +0,0 @@ -PROGRAM test; -(* - So far, this demonstrates if it links and works. - *) - - USES - Allegro5, al5gl, - {$IFDEF FPC} - GL; - {$ELSE} - OpenGL; - {$ENDIF} - - - - PROCEDURE DrawScene; - BEGIN - { Clear the RGB buffer and the depth buffer. } - glClear (GL_COLOR_BUFFER_BIT OR GL_DEPTH_BUFFER_BIT); - - { Set the modelview matrix to be the identity matrix. } - glLoadIdentity; - { Translate and rotate the object. } - glTranslatef (-2.5, 0.0, 0.0); - glRotatef (-30, 1.0, 0.0, 0.0); - glRotatef (30, 0.0, 1.0, 0.0); - glRotatef (30, 0.0, 0.0, 1.0); - - glColor3f (1.0, 0.0, 1.0); - - glLoadIdentity; - glTranslatef (2.5, 0.0, 0.0); - glRotatef (45, 1.0, 0.0, 0.0); - glRotatef (45, 0.0, 1.0, 0.0); - glRotatef (45, 0.0, 0.0, 1.0); - - glColor3f (0.0, 1.0, 0.0); - - glDisable (GL_TEXTURE_2D); - { Draw the sides of the cube. } - glBegin (GL_QUAD_STRIP); - glVertex3d ( 3, 3, -3); - glVertex3d ( 3, -3, -3); - glVertex3d (-3, 3, -3); - glVertex3d (-3, -3, -3); - glVertex3d (-3, 3, 3); - glVertex3d (-3, -3, 3); - glVertex3d ( 3, 3, 3); - glVertex3d ( 3, -3, 3); - glVertex3d ( 3, 3, -3); - glVertex3d ( 3, -3, -3); - glEnd; - - glColor3f (0.0, 0.0, 1.0); - - { Draw the top of the cube. } - glBegin (GL_QUADS); - glVertex3d (-3, -3, -3); - glVertex3d ( 3, -3, -3); - glVertex3d ( 3, -3, 3); - glVertex3d (-3, -3, 3); - glEnd; - END; - -VAR - Display: ALLEGRO_DISPLAYptr; -BEGIN - IF al_init THEN - BEGIN - WriteLn ('Allegro 5 installed and initialised. :)'); - al_set_new_display_flags (ALLEGRO_OPENGL); - al_set_new_display_option (ALLEGRO_DEPTH_SIZE, 16, ALLEGRO_SUGGEST); - Display := al_create_display (640, 480); - IF Display <> NIL THEN - BEGIN - WriteLn ('OpenGL display created.'); - DrawScene; - al_flip_display; - END - ELSE - WriteLn ('Could not create display.'); - END - ELSE - WriteLn ('Allegro 5 didn''t work! :(') -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5acodec.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5acodec.pas deleted file mode 100644 index fdd79ef9..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5acodec.pas +++ /dev/null @@ -1,47 +0,0 @@ -UNIT al5acodec; -(* See readme.txt for copyright information. - *) -(* Copyright (c) 2012 Guillermo Martínez J. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - *) - -{$include allegro.cfg} - -INTERFACE - - USES - al5base; - -(* Registers all the known audio file type handlers for @link(al_load_sample), @link(al_save_sample), @link(al_load_audio_stream), etc. - - Depending on what libraries are available, the full set of recognised extensions is: .wav, .flac, .ogg, .it, .mod, .s3m, .xm. - @return(@true on success.) - *) - FUNCTION al_init_acodec_addon: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_ACODEC_LIB_NAME; - -(* Returns the (compiled) version of the addon, in the same format as @link(al_get_allegro_version). *) - FUNCTION al_get_allegro_acodec_version: AL_UINT32; CDECL; - EXTERNAL ALLEGRO_ACODEC_LIB_NAME; - -IMPLEMENTATION - -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5acodec.ppu b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5acodec.ppu deleted file mode 100644 index edab6192..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5acodec.ppu and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5audio.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5audio.pas deleted file mode 100644 index da3c7f4c..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5audio.pas +++ /dev/null @@ -1,476 +0,0 @@ -UNIT al5audio; -(* See readme.txt for copyright information. - *) -(* Copyright (c) 2012 Guillermo Martínez J. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - *) - - -{$include allegro.cfg} - -INTERFACE - - USES - Allegro5, al5base; - - CONST - (* Internal, used to communicate with acodec. - * Must be in 512 <= n < 1024 *) - _KCM_STREAM_FEEDER_QUIT_EVENT_TYPE = 512; - - (* User event type emitted when a stream fragment is ready to be - * refilled with more audio data. - * Must be in 512 <= n < 1024 *) - ALLEGRO_EVENT_AUDIO_STREAM_FRAGMENT = 513; - ALLEGRO_EVENT_AUDIO_STREAM_FINISHED = 514; - - ALLEGRO_MAX_CHANNELS = 8; - - TYPE - (* Sample depth and type, and signedness. Mixers only use 32-bit signed float - (-1..+1). The unsigned value is a bit-flag applied to the depth value. - *) - ALLEGRO_AUDIO_DEPTH = ( - ALLEGRO_AUDIO_DEPTH_INT8 := $00, - ALLEGRO_AUDIO_DEPTH_INT16 := $01, - ALLEGRO_AUDIO_DEPTH_INT24 := $02, - ALLEGRO_AUDIO_DEPTH_FLOAT32 := $03, - - ALLEGRO_AUDIO_DEPTH_UNSIGNED := $08, - - (* For convenience *) - ALLEGRO_AUDIO_DEPTH_UINT16 := $09, {>4)+(v&0xF) should yield the - total channel count. - *) - ALLEGRO_CHANNEL_CONF = ( - ALLEGRO_CHANNEL_CONF_1 := $10, - ALLEGRO_CHANNEL_CONF_2 := $20, - ALLEGRO_CHANNEL_CONF_3 := $30, - ALLEGRO_CHANNEL_CONF_4 := $40, - ALLEGRO_CHANNEL_CONF_5_1 := $51, - ALLEGRO_CHANNEL_CONF_6_1 := $61, - ALLEGRO_CHANNEL_CONF_7_1 := $71 - ); - - - - ALLEGRO_PLAYMODE = ( - ALLEGRO_PLAYMODE_ONCE := $100, - ALLEGRO_PLAYMODE_LOOP := $101, - ALLEGRO_PLAYMODE_BIDIR := $102 - { - _ALLEGRO_PLAYMODE_STREAM_ONCE = 0x103, /* internal */ - _ALLEGRO_PLAYMODE_STREAM_ONEDIR = 0x104 /* internal */ - } - ); - - - - ALLEGRO_MIXER_QUALITY = ( - ALLEGRO_MIXER_QUALITY_POINT := $110, - ALLEGRO_MIXER_QUALITY_LINEAR := $111 - ); - - CONST - ALLEGRO_AUDIO_PAN_NONE: AL_FLOAT = -1000.0; - - TYPE - ALLEGRO_SAMPLEptr = AL_POINTER; - - - - ALLEGRO_SAMPLE_IDptr = ^ALLEGRO_SAMPLE_ID; - ALLEGRO_SAMPLE_ID = RECORD - _index, _id: AL_INT; - END; - - ALLEGRO_SAMPLE_INSTANCEptr = AL_POINTER; - - ALLEGRO_AUDIO_STREAMptr = AL_POINTER; - - ALLEGRO_MIXERptr = AL_POINTER; - - ALLEGRO_VOICEptr = AL_POINTER; - - ALLEGRO_MIXER_CALLBACK = PROCEDURE (buf: AL_VOIDptr; samples: AL_UINT; data: AL_VOIDptr); CDECL; - - ALLEGRO_SAMPLE_LOADER = FUNCTION (CONST filename: AL_STRptr): ALLEGRO_SAMPLEptr; CDECL; - - ALLEGRO_SAMPLE_SAVER = FUNCTION (CONST filename: AL_STRptr; spl: ALLEGRO_SAMPLEptr): AL_BOOL; CDECL; - - ALLEGRO_AUDIO_STREAM_LOADER = FUNCTION (CONST filename: AL_STRptr; buffer_count: AL_SIZE_T; samples: AL_UINT): ALLEGRO_AUDIO_STREAMptr; - - - -(* Sample functions *) - FUNCTION al_create_sample (buf: AL_VOIDptr; samples, freq: AL_UINT; depth: ALLEGRO_AUDIO_DEPTH; chan_conf: ALLEGRO_CHANNEL_CONF; free_buf: AL_BOOL): ALLEGRO_SAMPLEptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_destroy_sample (spl: ALLEGRO_SAMPLEptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* Sample instance functions *) - FUNCTION al_create_sample_instance (data: ALLEGRO_SAMPLEptr): ALLEGRO_SAMPLE_INSTANCEptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_destroy_sample_instance (spl: ALLEGRO_SAMPLE_INSTANCEptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_sample_frequency (CONST spl: ALLEGRO_SAMPLEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_length (CONST spl: ALLEGRO_SAMPLEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_depth (CONST spl: ALLEGRO_SAMPLEptr): ALLEGRO_AUDIO_DEPTH; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_channels (CONST spl: ALLEGRO_SAMPLEptr): ALLEGRO_CHANNEL_CONF; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_data (CONST spl: ALLEGRO_SAMPLEptr): AL_VOIDptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_sample_instance_frequency (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_length (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_position (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_sample_instance_speed (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_gain (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_pan (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_time (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_sample_instance_depth (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): ALLEGRO_AUDIO_DEPTH; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_channels (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): ALLEGRO_CHANNEL_CONF; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_playmode (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): ALLEGRO_PLAYMODE; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_sample_instance_playing (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample_instance_attached (CONST spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_sample_instance_position (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: AL_UINT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_sample_instance_length (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: AL_UINT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_sample_instance_speed (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_sample_instance_gain (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_sample_instance_pan (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_sample_instance_playmode (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: ALLEGRO_PLAYMODE): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_sample_instance_playing (spl: ALLEGRO_SAMPLE_INSTANCEptr; val: AL_BOOL): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_detach_sample_instance (spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_sample (spl: ALLEGRO_SAMPLE_INSTANCEptr; data: ALLEGRO_SAMPLEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_sample (spl: ALLEGRO_SAMPLE_INSTANCEptr): ALLEGRO_SAMPLEptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_play_sample_instance (spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_stop_sample_instance (spl: ALLEGRO_SAMPLE_INSTANCEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* Stream functions *) - FUNCTION al_create_audio_stream (buffer_count: AL_SIZE_T; samples, freq: AL_UINT; depth: ALLEGRO_AUDIO_DEPTH; chan_conf: ALLEGRO_CHANNEL_CONF): ALLEGRO_AUDIO_STREAMptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_destroy_audio_stream (stream: ALLEGRO_AUDIO_STREAMptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_drain_audio_stream (stream: ALLEGRO_AUDIO_STREAMptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_audio_stream_frequency (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_length (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_fragments (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_available_audio_stream_fragments (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_audio_stream_speed (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_gain (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_pan (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_audio_stream_channels (CONST stream: ALLEGRO_AUDIO_STREAMptr): ALLEGRO_CHANNEL_CONF; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_depth (CONST stream: ALLEGRO_AUDIO_STREAMptr): ALLEGRO_AUDIO_DEPTH; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_playmode (CONST stream: ALLEGRO_AUDIO_STREAMptr): ALLEGRO_PLAYMODE; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_audio_stream_playing (CONST spl: ALLEGRO_AUDIO_STREAMptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_attached (CONST spl: ALLEGRO_AUDIO_STREAMptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_audio_stream_fragment (CONST stream: ALLEGRO_AUDIO_STREAMptr): AL_VOIDptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_audio_stream_speed (stream: ALLEGRO_AUDIO_STREAMptr; val: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_audio_stream_gain (stream: ALLEGRO_AUDIO_STREAMptr; val: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_audio_stream_pan (stream: ALLEGRO_AUDIO_STREAMptr; val: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_audio_stream_playmode (stream: ALLEGRO_AUDIO_STREAMptr; val: ALLEGRO_PLAYMODE): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_set_audio_stream_playing (stream: ALLEGRO_AUDIO_STREAMptr; val: AL_BOOL): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_detach_audio_stream (stream: ALLEGRO_AUDIO_STREAMptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_audio_stream_fragment (stream: ALLEGRO_AUDIO_STREAMptr; val: AL_VOIDptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_rewind_audio_stream (stream: ALLEGRO_AUDIO_STREAMptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_seek_audio_stream_secs (stream: ALLEGRO_AUDIO_STREAMptr; time: AL_DOUBLE): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_position_secs (stream: ALLEGRO_AUDIO_STREAMptr): AL_DOUBLE; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_stream_length_secs (stream: ALLEGRO_AUDIO_STREAMptr): AL_DOUBLE; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_audio_stream_loop_secs (stream: ALLEGRO_AUDIO_STREAMptr; start, finish: AL_DOUBLE): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_audio_stream_event_source (stream: ALLEGRO_AUDIO_STREAMptr): ALLEGRO_EVENT_SOURCEptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* Mixer functions *) - FUNCTION al_create_mixer (freq: AL_UINT; depth: ALLEGRO_AUDIO_DEPTH; chan_conf: ALLEGRO_CHANNEL_CONF): ALLEGRO_MIXERptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_destroy_mixer (mixer: ALLEGRO_MIXERptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_attach_sample_instance_to_mixer (sample: ALLEGRO_SAMPLE_INSTANCEptr; mixer: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_attach_audio_stream_to_mixer (stream: ALLEGRO_AUDIO_STREAMptr; mixer: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_attach_mixer_to_mixer (mixerA, mixerB: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_mixer_postprocess_callback (mixer: ALLEGRO_MIXERptr; cb: ALLEGRO_MIXER_CALLBACK; data: AL_VOIDptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_mixer_frequency (CONST mixer: ALLEGRO_MIXERptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_mixer_channels (CONST mixer: ALLEGRO_MIXERptr): ALLEGRO_CHANNEL_CONF; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_mixer_depth (CONST mixer: ALLEGRO_MIXERptr): ALLEGRO_AUDIO_DEPTH; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_mixer_quality (CONST mixer: ALLEGRO_MIXERptr): ALLEGRO_MIXER_QUALITY; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_mixer_gain (CONST mixer: ALLEGRO_MIXERptr): AL_FLOAT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_mixer_playing (CONST mixer: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_mixer_attached (CONST mixer: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_mixer_frequency (mixer: ALLEGRO_MIXERptr; val: AL_UINT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_mixer_quality (mixer: ALLEGRO_MIXERptr; val: ALLEGRO_MIXER_QUALITY): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_mixer_gain (mixer: ALLEGRO_MIXERptr; gain: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_mixer_playing (mixer: ALLEGRO_MIXERptr; val: AL_BOOL): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_detach_mixer (mixer: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* Voice functions *) - FUNCTION al_create_voice (freq: AL_UINT; depth: ALLEGRO_AUDIO_DEPTH; chan_conf: ALLEGRO_CHANNEL_CONF): ALLEGRO_VOICEptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_destroy_voice (voice: ALLEGRO_VOICEptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_attach_sample_instance_to_voice (sample: ALLEGRO_SAMPLE_INSTANCEptr; voice: ALLEGRO_VOICEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_attach_audio_stream_to_voice (stream: ALLEGRO_AUDIO_STREAMptr; voice: ALLEGRO_VOICEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_attach_mixer_to_voice (mixer: ALLEGRO_MIXERptr; voice: ALLEGRO_VOICEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_detach_voice (voice: ALLEGRO_VOICEptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_voice_frequency (CONST voice: ALLEGRO_VOICEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_voice_position (CONST voice: ALLEGRO_VOICEptr): AL_UINT; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_voice_channels (CONST voice: ALLEGRO_VOICEptr): ALLEGRO_CHANNEL_CONF; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_voice_depth (CONST voice: ALLEGRO_VOICEptr): ALLEGRO_AUDIO_DEPTH; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_voice_playing (CONST voice: ALLEGRO_VOICEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_voice_position (voice: ALLEGRO_VOICEptr; val: AL_UINT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_voice_playing (voice: ALLEGRO_VOICEptr; val: AL_BOOL): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* Misc. audio functions *) - FUNCTION al_install_audio: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_uninstall_audio; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_is_audio_installed: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_allegro_audio_version: AL_UINT32; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - - FUNCTION al_get_channel_count (conf: ALLEGRO_CHANNEL_CONF): AL_SIZE_T; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_audio_depth_size (conf: ALLEGRO_AUDIO_DEPTH): AL_SIZE_T; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* Simple audio layer *) - FUNCTION al_reserve_samples (reserve_samples: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_get_default_mixer: ALLEGRO_MIXERptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_set_default_mixer (mixer: ALLEGRO_MIXERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_restore_default_mixer: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - FUNCTION al_play_sample (data: ALLEGRO_SAMPLEptr; gain, pan, speed: AL_FLOAT; loop: ALLEGRO_PLAYMODE; ret_id: ALLEGRO_SAMPLE_IDptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_stop_sample (spl_id: ALLEGRO_SAMPLE_IDptr); CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - PROCEDURE al_stop_samples; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME; - -(* File type handlers *) - FUNCTION al_register_sample_loader (CONST ext: STRING; loader: ALLEGRO_SAMPLE_LOADER): AL_BOOL; INLINE; - FUNCTION al_register_sample_saver (CONST ext: STRING; saver: ALLEGRO_SAMPLE_SAVER): AL_BOOL; INLINE; - FUNCTION al_register_audio_stream_loader (CONST ext: STRING; stream_loader: ALLEGRO_AUDIO_STREAM_LOADER): AL_BOOL; INLINE; - - {TODO: These needs Allegro's file access. - -ALLEGRO_KCM_AUDIO_FUNC(bool, al_register_sample_loader_f, (const char *ext, - ALLEGRO_SAMPLE *( *loader)(ALLEGRO_FILE *fp))); -ALLEGRO_KCM_AUDIO_FUNC(bool, al_register_sample_saver_f, (const char *ext, - bool ( *saver)(ALLEGRO_FILE *fp, ALLEGRO_SAMPLE *spl))); -ALLEGRO_KCM_AUDIO_FUNC(bool, al_register_audio_stream_loader_f, (const char *ext, - ALLEGRO_AUDIO_STREAM *( *stream_loader)(ALLEGRO_FILE *fp, - size_t buffer_count, unsigned int samples))); - } - - FUNCTION al_load_sample (CONST filename: STRING): ALLEGRO_SAMPLEptr; INLINE; - FUNCTION al_save_sample (CONST filename: STRING; spl: ALLEGRO_SAMPLEptr): AL_BOOL; INLINE; - FUNCTION al_load_audio_stream (CONST filename: STRING; buffer_count: AL_SIZE_T; samples: AL_UINT): ALLEGRO_AUDIO_STREAMptr; INLINE; - - {TODO: These needs Allegro's file access. - -ALLEGRO_KCM_AUDIO_FUNC(ALLEGRO_SAMPLE *, al_load_sample_f, (ALLEGRO_FILE* fp, const char *ident)); -ALLEGRO_KCM_AUDIO_FUNC(bool, al_save_sample_f, (ALLEGRO_FILE* fp, const char *ident, - ALLEGRO_SAMPLE *spl)); -ALLEGRO_KCM_AUDIO_FUNC(ALLEGRO_AUDIO_STREAM *, al_load_audio_stream_f, (ALLEGRO_FILE* fp, const char *ident, - size_t buffer_count, unsigned int samples)); - } - -IMPLEMENTATION - -(* File type handlers *) - FUNCTION _al_register_sample_loader_ (CONST ext: AL_STRptr; loader: ALLEGRO_SAMPLE_LOADER): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME NAME 'al_register_sample_loader'; - - FUNCTION al_register_sample_loader (CONST ext: STRING; loader: ALLEGRO_SAMPLE_LOADER): AL_BOOL; - BEGIN - al_register_sample_loader := _al_register_sample_loader_ (AL_STRptr (Ext), loader); - END; - - - - FUNCTION _al_register_sample_saver_ (CONST ext: AL_STRptr; saver: ALLEGRO_SAMPLE_SAVER): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME NAME 'al_register_sample_saver'; - - FUNCTION al_register_sample_saver (CONST ext: STRING; saver: ALLEGRO_SAMPLE_SAVER): AL_BOOL; - BEGIN - al_register_sample_saver := _al_register_sample_saver_ (AL_STRptr (Ext), saver); - END; - - - - FUNCTION _al_register_audio_stream_loader_ (CONST ext: AL_STRptr; stream_loader: ALLEGRO_AUDIO_STREAM_LOADER): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME NAME 'al_register_audio_stream_loader'; - - FUNCTION al_register_audio_stream_loader (CONST ext: STRING; stream_loader: ALLEGRO_AUDIO_STREAM_LOADER): AL_BOOL; - BEGIN - al_register_audio_stream_loader := _al_register_audio_stream_loader_ (AL_STRptr (Ext), stream_loader); - END; - - - - FUNCTION _al_load_sample_ (CONST filename: AL_STRptr): ALLEGRO_SAMPLEptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME NAME 'al_load_sample'; - - FUNCTION al_load_sample (CONST filename: STRING): ALLEGRO_SAMPLEptr; - BEGIN - al_load_sample := _al_load_sample_ (AL_STRptr (filename)); - END; - - - - FUNCTION _al_save_sample_ (CONST filename: AL_STRptr; spl: ALLEGRO_SAMPLEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME NAME 'al_save_sample'; - - FUNCTION al_save_sample (CONST filename: STRING; spl: ALLEGRO_SAMPLEptr): AL_BOOL; - BEGIN - al_save_sample := _al_save_sample_ (AL_STRptr (filename), spl); - END; - - - - FUNCTION _al_load_audio_stream_ (CONST filename: AL_STRptr; buffer_count: AL_SIZE_T; samples: AL_UINT): ALLEGRO_AUDIO_STREAMptr; CDECL; - EXTERNAL ALLEGRO_AUDIO_LIB_NAME NAME 'al_load_audio_stream'; - - FUNCTION al_load_audio_stream (CONST filename: STRING; buffer_count: AL_SIZE_T; samples: AL_UINT): ALLEGRO_AUDIO_STREAMptr; - BEGIN - al_load_audio_stream := _al_load_audio_stream_ (AL_STRptr (Filename), buffer_count, samples); - END; - -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5audio.ppu b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5audio.ppu deleted file mode 100644 index aeb0e9f4..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5audio.ppu and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5base.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5base.pas deleted file mode 100644 index 6ad0a656..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5base.pas +++ /dev/null @@ -1,207 +0,0 @@ -UNIT al5base; -(* '' THEN - ButtonsPtr := AL_STRptr (buttons) - ELSE - ButtonsPtr := NIL; - al_show_native_message_box := _al_show_native_message_box ( - display, AL_STRptr (Title), AL_STRptr (Heading), AL_STRptr (Str), ButtonsPtr, flags - ); - END; - - - - FUNCTION _al_open_native_text_log_ (CONST title: AL_STRptr; flags: AL_INT): ALLEGRO_TEXTLOGptr; CDECL; - EXTERNAL ALLEGRO_NATIVE_DLG_LIB_NAME NAME 'al_open_native_text_log'; - - FUNCTION al_open_native_text_log (CONST title: STRING; flags: AL_INT): ALLEGRO_TEXTLOGptr; - BEGIN - al_open_native_text_log := _al_open_native_text_log_ (AL_STRptr (Title), flags); - END; - - - - PROCEDURE _al_append_native_text_log_ (textlog: ALLEGRO_TEXTLOGptr; CONST str: AL_STRptr); CDECL; - EXTERNAL ALLEGRO_NATIVE_DLG_LIB_NAME NAME 'al_append_native_text_log'; - - PROCEDURE al_append_native_text_log (textlog: ALLEGRO_TEXTLOGptr; CONST str: STRING); - BEGIN - _al_append_native_text_log_ (textlog, AL_STRptr (Str)); - END; - -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5primitives.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5primitives.pas deleted file mode 100644 index c8fb7f38..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5primitives.pas +++ /dev/null @@ -1,202 +0,0 @@ -UNIT al5primitives; -(*< *) -(* Copyright (c) 2012 Guillermo Martínez J. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - *) - -{$include allegro.cfg} - -INTERFACE - - USES - Allegro5, al5base; - - TYPE - ALLEGRO_PRIM_TYPE = ( - ALLEGRO_PRIM_LINE_LIST, - ALLEGRO_PRIM_LINE_STRIP, - ALLEGRO_PRIM_LINE_LOOP, - ALLEGRO_PRIM_TRIANGLE_LIST, - ALLEGRO_PRIM_TRIANGLE_STRIP, - ALLEGRO_PRIM_TRIANGLE_FAN, - ALLEGRO_PRIM_POINT_LIST, - ALLEGRO_PRIM_NUM_TYPES - ); - - - - ALLEGRO_PRIM_ATTR = ( - ALLEGRO_PRIM_ATTR_NONE := 0, - ALLEGRO_PRIM_POSITION := 1, - ALLEGRO_PRIM_COLOR_ATTR, - ALLEGRO_PRIM_TEX_COORD, - ALLEGRO_PRIM_TEX_COORD_PIXEL, - ALLEGRO_PRIM_ATTR_NUM - ); - - - - ALLEGRO_PRIM_STORAGE = ( - ALLEGRO_PRIM_FLOAT_2 := 0, - ALLEGRO_PRIM_FLOAT_3, - ALLEGRO_PRIM_SHORT_2 - ); - - CONST - ALLEGRO_PRIM_STORAGE_NONE = ALLEGRO_PRIM_FLOAT_2; - ALLEGRO_VERTEX_CACHE_SIZE = 256; - - - - ALLEGRO_PRIM_QUALITY = 10; - - TYPE - ALLEGRO_VERTEX_ELEMENTptr = ^ALLEGRO_VERTEX_ELEMENT; - ALLEGRO_VERTEX_ELEMENT = RECORD - attribute: ALLEGRO_PRIM_ATTR; - storage: ALLEGRO_PRIM_STORAGE; - offset: AL_INT; - END; - - - ALLEGRO_VERTEX_DECLptr = AL_POINTER; - - - ALLEGRO_VERTEXptr = ^ALLEGRO_VERTEX; - ALLEGRO_VERTEX = RECORD - x, y, z: AL_FLOAT; - u, v: AL_FLOAT; - color: ALLEGRO_COLOR; - END; - - - - ALLEGRO_INIT_TRIANGLE_PROC = PROCEDURE (state: AL_UINTPTR_T; v1, v2, v3: ALLEGRO_VERTEXptr); CDECL; - ALLEGRO_FIRST_TRIANGLE_PROC = PROCEDURE (state: AL_UINTPTR_T; x, y, l1, l2: AL_INT); CDECL; - ALLEGRO_DRAW_TRIANGLE_PROC = PROCEDURE (state: AL_UINTPTR_T; x1, y, x2: AL_INT); CDECL; - - ALLEGRO_FIRST_LINE_PROC = PROCEDURE (state: AL_UINTPTR_T; px, py: AL_INT; v1, v2: ALLEGRO_VERTEXptr); CDECL; - ALLEGRO_DRAW_LINE_PROC = PROCEDURE (state: AL_UINTPTR_T; x, y: AL_INT); CDECL; - - ALLEGRO_STEP_PROC = PROCEDURE (state: AL_UINTPTR_T; _type: AL_INT); CDECL; - - ALLEGRO_SPLINE_CONTROL_POINTS = ARRAY [0..7] OF AL_FLOAT; - - FUNCTION al_get_allegro_primitives_version: AL_UINT32; CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - -(* Primary Functions *) - FUNCTION al_init_primitives_addon: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_shutdown_primitives_addon; CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - FUNCTION al_draw_prim (CONST vtxs: AL_VOIDptr; CONST decl: ALLEGRO_VERTEX_DECLptr; texture: ALLEGRO_BITMAPptr; start, finish: AL_INT; _type: ALLEGRO_PRIM_TYPE): AL_INT; CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - FUNCTION al_draw_indexed_prim (CONST vtxs: AL_VOIDptr; CONST decl: ALLEGRO_VERTEX_DECLptr; texture: ALLEGRO_BITMAPptr; CONST indices: ARRAY OF AL_INT; num_vtx: AL_INT; _type: ALLEGRO_PRIM_TYPE): AL_INT; {TODO: Need to test if the "indices" parameter does work correctly } - - FUNCTION al_create_vertex_decl (CONST elements: ALLEGRO_VERTEX_ELEMENTptr; stride: AL_INT): ALLEGRO_VERTEX_DECLptr; CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_destroy_vertex_decl (decl: ALLEGRO_VERTEX_DECLptr); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - -(* Custom primitives *) - PROCEDURE al_draw_soft_triangle (v1, v2, v3: ALLEGRO_VERTEXptr; state: AL_UINTPTR_T; init: ALLEGRO_INIT_TRIANGLE_PROC; first: ALLEGRO_FIRST_TRIANGLE_PROC; step: ALLEGRO_STEP_PROC; draw: ALLEGRO_DRAW_TRIANGLE_PROC); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_soft_line (v1, v2: ALLEGRO_VERTEXptr; state: AL_UINTPTR_T; first: ALLEGRO_FIRST_LINE_PROC; step: ALLEGRO_STEP_PROC; draw: ALLEGRO_DRAW_LINE_PROC); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - -(* High level primitives *) - PROCEDURE al_draw_line (x1, y1, x2, y2: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_triangle (x1, y1, x2, y2, x3, y3: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_rectangle (x1, y1, x2, y2: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_rounded_rectangle (x1, y1, x2, y2, rx, ry: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - - PROCEDURE al_calculate_arc (dest: AL_FLOATptr; stride: AL_INT; cx, cy, rx, ry, start_theta, delta_theta, thickness: AL_FLOAT; num_segments: AL_INT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_circle (cx, cy, r: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_ellipse (cx, cy, rx, ry: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_arc (cx, cy, r, start_theta, delta_theta: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_elliptical_arc (cx, cy, rx, ry, start_theta, delta_theta: AL_FLOAT; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - - PROCEDURE al_calculate_spline (dest: AL_FLOATptr; stride: AL_INT; points: ALLEGRO_SPLINE_CONTROL_POINTS; thickness: AL_FLOAT; num_segments: AL_INT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_spline (points: ALLEGRO_SPLINE_CONTROL_POINTS; color: ALLEGRO_COLOR; thickness: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - - PROCEDURE al_calculate_ribbon (dest: AL_FLOATptr; dest_stride: AL_INT; CONST points: ARRAY OF AL_FLOAT; points_stride: AL_INT; thickness: AL_FLOAT; num_segments: AL_INT); - PROCEDURE al_draw_ribbon (CONST points: ARRAY OF AL_FLOAT; points_stride: AL_INT; color: ALLEGRO_COLOR; thickness: AL_FLOAT; num_segments: AL_INT); - - PROCEDURE al_draw_filled_triangle (x1, y1, x2, y2, x3, y3: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_filled_rectangle (x1, y1, x2, y2: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_filled_ellipse (cx, cy, rx, ry: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_filled_circle (cx, cy, r: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - PROCEDURE al_draw_filled_rounded_rectangle (x1, y1, x2, y2, rx, ry: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME; - -IMPLEMENTATION - - USES - { Next unit isn't needed but it must be added to prevent a "/usr/lib/nvidia-96/libGLcore.so.1: undefined reference to `__moddi3'" error. (?) } -{$IFDEF FPC} - GL; -{$ELSE} - OpenGL; -{$ENDIF} - - - - FUNCTION _al_draw_indexed_prim_ (CONST vtxs: AL_VOIDptr; CONST decl: ALLEGRO_VERTEX_DECLptr; texture: ALLEGRO_BITMAPptr; CONST indices: AL_INTptr; num_vtx: AL_INT; _type: ALLEGRO_PRIM_TYPE): AL_INT; CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME NAME 'al_draw_indexed_prim'; - - FUNCTION al_draw_indexed_prim (CONST vtxs: AL_VOIDptr; CONST decl: ALLEGRO_VERTEX_DECLptr; texture: ALLEGRO_BITMAPptr; CONST indices: ARRAY OF AL_INT; num_vtx: AL_INT; _type: ALLEGRO_PRIM_TYPE): AL_INT; - BEGIN - al_draw_indexed_prim := _al_draw_indexed_prim_ (vtxs, decl, texture, @indices[0], num_vtx, _type); - END; - - PROCEDURE _al_calculate_ribbon_ (dest: AL_FLOATptr; dest_stride: AL_INT; CONST points: AL_FLOATptr; points_stride: AL_INT; thickness: AL_FLOAT; num_segments: AL_INT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME NAME 'al_calculate_ribbon'; - - PROCEDURE al_calculate_ribbon (dest: AL_FLOATptr; dest_stride: AL_INT; CONST points: ARRAY OF AL_FLOAT; points_stride: AL_INT; thickness: AL_FLOAT; num_segments: AL_INT); - BEGIN - _al_calculate_ribbon_ (dest, dest_stride, @points[0], points_stride, thickness, num_segments); - END; - - PROCEDURE _al_draw_ribbon_ (CONST points: AL_FLOATptr; points_stride: AL_INT; color: ALLEGRO_COLOR; thickness: AL_FLOAT; num_segments: AL_INT); CDECL; - EXTERNAL ALLEGRO_PRIMITIVES_LIB_NAME NAME 'al_draw_ribbon'; - - PROCEDURE al_draw_ribbon (CONST points: ARRAY OF AL_FLOAT; points_stride: AL_INT; color: ALLEGRO_COLOR; thickness: AL_FLOAT; num_segments: AL_INT); - BEGIN - _al_draw_ribbon_ (@points[0], points_stride, color, thickness, num_segments); - END; - -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5primitives.ppu b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5primitives.ppu deleted file mode 100644 index 9d643b7d..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5primitives.ppu and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5ttf.pas b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5ttf.pas deleted file mode 100644 index 196ffc9d..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/al5ttf.pas +++ /dev/null @@ -1,57 +0,0 @@ -UNIT al5ttf; -(* ABGR). - - The only exception to this @code(ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE) which will always have the components as 4 bytes corresponding to red, green, blue and alpha, in this order, independent of the endianness. -@unorderedlist( - @item(ALLEGRO_PIXEL_FORMAT_ANY - Let the driver choose a format. This is the default format at -program start.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_NO_ALPHA - Let the driver choose a format without alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_WITH_ALPHA - Let the driver choose a format with alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_15_NO_ALPHA - Let the driver choose a 15 bit format without alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_16_NO_ALPHA - Let the driver choose a 16 bit format without alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_16_WITH_ALPHA - Let the driver choose a 16 bit format with alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_24_NO_ALPHA - Let the driver choose a 24 bit format without alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_32_NO_ALPHA - Let the driver choose a 32 bit format without alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA - Let the driver choose a 32 bit format with alpha.) - @item(ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit) - @item(ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit) - @item(ALLEGRO_PIXEL_FORMAT_ARGB_4444 - 16 bit) - @item(ALLEGRO_PIXEL_FORMAT_RGB_888 - 24 bit) - @item(ALLEGRO_PIXEL_FORMAT_RGB_565 - 16 bit) - @item(ALLEGRO_PIXEL_FORMAT_RGB_555 - 15 bit) - @item(ALLEGRO_PIXEL_FORMAT_RGBA_5551 - 16 bit) - @item(ALLEGRO_PIXEL_FORMAT_ARGB_1555 - 16 bit) - @item(ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit) - @item(ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit) - @item(ALLEGRO_PIXEL_FORMAT_BGR_888 - 24 bit) - @item(ALLEGRO_PIXEL_FORMAT_BGR_565 - 16 bit) - @item(ALLEGRO_PIXEL_FORMAT_BGR_555 - 15 bit) - @item(ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit) - @item(ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit) - @item(ALLEGRO_PIXEL_FORMAT_ABGR_F32 - 128 bit) - @item(ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE - Like the version without _LE, but the component order is guaranteed to be red, green, blue, alpha. This only makes a difference on big endian systems, on little endian it is just an alias.) - @item(ALLEGRO_PIXEL_FORMAT_RGBA_4444 - 16bit) -) - @seealso(al_set_new_bitmap_format) @seealso(al_get_bitmap_format) - *) - ALLEGRO_PIXEL_FORMAT = ( - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY := 0, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_NO_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_WITH_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_15_NO_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_16_NO_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_16_WITH_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_24_NO_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_32_NO_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ARGB_8888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGBA_8888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ARGB_4444, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGB_888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGB_565, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGB_555, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGBA_5551, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ARGB_1555, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ABGR_8888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_XBGR_8888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_BGR_888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_BGR_565, - { @exclude } - ALLEGRO_PIXEL_FORMAT_BGR_555, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGBX_8888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_XRGB_8888, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ABGR_F32, - { @exclude } - ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE, - { @exclude } - ALLEGRO_PIXEL_FORMAT_RGBA_4444, - { @exclude } - ALLEGRO_NUM_PIXEL_FORMATS - ); - - CONST - (* Bitmap flags. Documented at al_set_new_bitmap_flags. *) - { @exclude } - ALLEGRO_MEMORY_BITMAP = $0001; - { @exclude } - ALLEGRO_KEEP_BITMAP_FORMAT = $0002; - { @exclude } - ALLEGRO_FORCE_LOCKING = $0004; - { @exclude } - ALLEGRO_NO_PRESERVE_TEXTURE = $0008; - { @exclude } - ALLEGRO_ALPHA_TEST = $0010; - { @exclude } - _ALLEGRO_INTERNAL_OPENGL = $0020; - { @exclude } - ALLEGRO_MIN_LINEAR = $0040; - { @exclude } - ALLEGRO_MAG_LINEAR = $0080; - { @exclude } - ALLEGRO_MIPMAP = $0100; - { @exclude } - ALLEGRO_NO_PREMULTIPLIED_ALPHA = $0200; - { @exclude } - ALLEGRO_VIDEO_BITMAP = $0400; - - - - (* Flags for the blitting functions. Documented at al_draw_bitmap. *) - { @exclude } - ALLEGRO_FLIP_HORIZONTAL = $00001; - { @exclude } - ALLEGRO_FLIP_VERTICAL = $00002; - - - - (* Locking flags. Documented at al_lock_bitmap. *) - { @exclude } - ALLEGRO_LOCK_READWRITE = 0; - { @exclude } - ALLEGRO_LOCK_READONLY = 1; - { @exclude } - ALLEGRO_LOCK_WRITEONLY = 2; - - TYPE - (* Blending modes. Documented at al_set_blender. *) - ALLEGRO_BLEND_MODE = ( - { @exclude } - ALLEGRO_ZERO := 0, - { @exclude } - ALLEGRO_ONE := 1, - { @exclude } - ALLEGRO_ALPHA := 2, - { @exclude } - ALLEGRO_INVERSE_ALPHA := 3 - ); - - - - (* Blending modes. Documented at al_set_blender. *) - ALLEGRO_BLEND_OPERATIONS = ( - { @exclude } - ALLEGRO_ADD := 0, - { @exclude } - ALLEGRO_SRC_MINUS_DEST := 1, - { @exclude } - ALLEGRO_DEST_MINUS_SRC := 2, - { @exclude } - ALLEGRO_NUM_BLEND_OPERATIONS - ); - - - (* Pointer to @link(ALLEGRO_LOCKED_REGION). *) - ALLEGRO_LOCKED_REGIONptr = ^ALLEGRO_LOCKED_REGION; - (* Users who wish to manually edit or read from a bitmap are required to lock it first. The @code(ALLEGRO_LOCKED_REGION) structure represents the locked region of the bitmap. This call will work with any bitmap, including memory bitmaps. - @seealso(al_lock_bitmap) @seealso(al_lock_bitmap_region) @seealso(al_unlock_bitmap) @seealso(ALLEGRO_PIXEL_FORMAT) - *) - ALLEGRO_LOCKED_REGION = RECORD - (* Points to the leftmost pixel of the first row (row 0) of the locked region. *) - data: AL_VOIDptr; - (* Indicates the pixel format of the data. *) - format, - (* Gives the size in bytes of a single row (also known as the stride). The pitch may be greater than @code(width * pixel_size) due to padding; this is not uncommon. It is also not uncommon for the pitch to be negative (the bitmap may be upside down). *) - pitch, - (* Number of bytes used to represent a single pixel. *) - pixel_size: AL_INT; - END; - - - -(* Sets the pixel format for newly created bitmaps. The default format is @code(ALLEGRO_PIXEL_FORMAT_ANY) and means the display driver will choose the best format. - @seealso(ALLEGRO_PIXEL_FORMAT) @seealso(al_get_new_bitmap_format) - @seealso(al_get_bitmap_format) - *) - PROCEDURE al_set_new_bitmap_format (format: ALLEGRO_PIXEL_FORMAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Sets the flags to use for newly created bitmaps. Valid flags are: - @unorderedlist( - @item(@bold(ALLEGRO_VIDEO_BITMAP) Creates a bitmap that resides in the video card memory. These types of bitmaps receive the greatest benefit from hardware acceleration. @link(al_set_new_bitmap_flags) will implicitly set this flag unless @code(ALLEGRO_MEMORY_BITMAP) is present.) - @item(@bold(ALLEGRO_MEMORY_BITMAP) Create a bitmap residing in system memory. Operations on, and with, memory bitmaps will not be hardware accelerated. However, direct pixel access can be relatively quick compared to video bitmaps, which depend on the display driver in use. @italic(Note: Allegro’s software rendering routines are currently very unoptimised.)) - @item(@bold(ALLEGRO_KEEP_BITMAP_FORMAT) Only used when loading bitmaps from disk files, forces the resulting ALLEGRO_BITMAP to use the same format as the file. @italic(This is not yet honoured.)) - @item(@bold(ALLEGRO_FORCE_LOCKING) When drawing to a bitmap with this flag set, always use pixel locking and draw to it using Allegro’s software drawing primitives. This should never be used if you plan to draw to the bitmap using Allegro’s graphics primitives as it would cause severe performance penalties. However if you know that the bitmap will only ever be accessed by locking it, no unneeded FBOs will be created for it in the OpenGL drivers.) - @item(@bold(ALLEGRO_NO_PRESERVE_TEXTURE) Normally, every effort is taken to preserve the contents of bitmaps, since Direct3D may forget them. This can take extra processing time. If you know it doesn’t matter if a bitmap keeps its pixel data, for example its a temporary buffer, use this flag to tell Allegro not to attempt to preserve its contents. This can increase performance of your game or application, but there is a catch. See ALLEGRO_EVENT_DISPLAY_LOST for further information.) - @item(@bold(ALLEGRO_ALPHA_TEST) This is a driver hint only. It tells the graphics driver to do alpha testing instead of alpha blending on bitmaps created with this flag. Alpha testing is usually faster and preferred if your bitmaps have only one level of alpha @(0@). This flag is currently not widely implemented @(i.e., only for memory bitmaps@).) - @item(@bold(ALLEGRO_MIN_LINEAR) When drawing a scaled down version of the bitmap, use linear filtering. This usually looks better. You can also combine it with the MIPMAP flag for even better quality.) - @item(@bold(ALLEGRO_MAG_LINEAR) When drawing a magnified version of a bitmap, use linear filtering. This will cause the picture to get blurry instead of creating a big rectangle for each pixel. It depends on how you want things to look like whether you want to use this or not.) - @item(@bold(ALLEGRO_MIPMAP) This can only be used for bitmaps whose width and height is a power of two. In that case, it will generate mipmaps and use them when drawing scaled down versions. For example if the bitmap is 64x64, then extra bitmaps of sizes 32x32, 16x16, 8x8, 4x4, 2x2 and 1x1 will be created always containing a scaled down version of the original.) - @item(@bold(ALLEGRO_NO_PREMULTIPLIED_ALPHA) By default, Allegro pre-multiplies the alpha channel of an image with the images color data when it loads it. Typically that would look something like this: -@longcode(# - r := get_float_byte (); - g := get_float_byte (); - b := get_float_byte (); - a := get_float_byte (); - - r := r * a; - g := g * a; - b := b * a; - - set_image_pixel (x, y, r, g, b, a); -#) -The reason for this can be seen in the Allegro example ex_premulalpha, ie, using pre-multiplied alpha gives more accurate color results in some cases. To use alpha blending with images loaded with pre-multiplied alpha, you would use the default blending mode, which is set with @code(al_set_blender @(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA@)) to set the correct blender. This has some caveats. First, as mentioned above, drawing such an image can result in less accurate color blending @(when drawing an image with linear filtering on, the edges will be darker than they should be@). Second, the behaviour is somewhat confusing, which is explained in the example below. -@longcode(# -// Load and create bitmaps with an alpha channel - al_set_new_bitmap_format (ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA); -// Load some bitmap with alpha in it - bmp = al_load_bitmap ('some_alpha_bitmap.png'); -// We will draw to this buffer and then draw this buffer to the screen - tmp_buffer = al_create_bitmap (SCREEN_W, SCREEN_H); -// Set the buffer as the target and clear it - al_set_target_bitmap (tmp_buffer); - al_clear_to_color (al_map_rgba_f (0, 0, 0, 1)); -// Draw the bitmap to the temporary buffer - al_draw_bitmap (bmp, 0, 0, 0); -// Finally, draw the buffer to the screen -// The output will look incorrect (may take close inspection -// depending on the bitmap -- it may also be very obvious) - al_set_target_bitmap (al_get_backbuffer (display)); - al_draw_bitmap (tmp_buffer, 0, 0, 0); -#) - ) - ) - To explain further, if you have a pixel with 0.5 alpha, and you’re using (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA) for blending, the formula is: -@longcode(# - a := da * dst + sa * src -#) -Expands to: -@longcode(# - result_a := dst_a * (1-0.5) + 0.5 * 0.5; -#) - So if you draw the image to the temporary buffer, it is blended once resulting in 0.75 alpha, then drawn again to the screen, blended in the same way, resulting in a pixel has 0.1875 as an alpha value. - @seealso(al_get_new_bitmap_flags) @seealso(al_get_bitmap_flags) - *) - PROCEDURE al_set_new_bitmap_flags (flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Returns the format used for newly created bitmaps. - @seealso(ALLEGRO_PIXEL_FORMAT) @seealso(al_set_new_bitmap_format) - *) - FUNCTION al_get_new_bitmap_format: ALLEGRO_PIXEL_FORMAT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Returns the flags used for newly created bitmaps. - @seealso(al_set_new_bitmap_flags) - *) - FUNCTION al_get_new_bitmap_flags: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* A convenience function which does the same as @longcode(# - al_set_new_bitmap_flags (al_get_new_bitmap_flags | flag); -#) - @seealso(al_set_new_bitmap_flags) @seealso(al_get_new_bitmap_flags) @seealso(al_get_bitmap_flags) - *) - PROCEDURE al_add_new_bitmap_flag (flag: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(* Returns the width of a bitmap in pixels. *) - FUNCTION al_get_bitmap_width (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Returns the height of a bitmap in pixels. *) - FUNCTION al_get_bitmap_height (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Returns the pixel format of a bitmap. - @seealso(ALLEGRO_PIXEL_FORMAT) @seealso(al_set_new_bitmap_flags) - *) - FUNCTION al_get_bitmap_format (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Return the flags user to create the bitmap. - @seealso(al_set_new_bitmap_flags) - *) - FUNCTION al_get_bitmap_flags (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(* Creates a new bitmap using the bitmap format and flags for the current thread. Blitting between bitmaps of differing formats, or blitting between memory bitmaps and display bitmaps may be slow. - - Unless you set the ALLEGRO_MEMORY_BITMAP flag, the bitmap is created for the current display. Blitting to another display may be slow. -If a display bitmap is created, there may be limitations on the allowed dimensions. For example a DirectX or OpenGL backend usually has a maximum allowed texture size - so if bitmap creation fails for very large dimensions, you may want to re-try with a smaller bitmap. Some platforms also dictate a minimum texture size, which is relevant if you plan to use this bitmap with the primitives addon. If you try to create a bitmap smaller than this, this call will not fail but the returned bitmap will be a section of a larger bitmap with the minimum size. This minimum size is 16 by 16. - - Some platforms do not directly support display bitmaps whose dimensions are not powers of two. Allegro handles this by creating a larger bitmap that has dimensions that are powers of two and then returning a section of that bitmap with the dimensions you requested. This can be relevant if you plan to use this bitmap with the primitives addon but shouldn’t be an issue otherwise. - @seealso(al_set_new_bitmap_format) @seealso(al_set_new_bitmap_flags) @seealso(al_clone_bitmap) @seealso(al_create_sub_bitmap) - *) - FUNCTION al_create_bitmap (w, h: AL_INT): ALLEGRO_BITMAPptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Destroys the given bitmap, freeing all resources used by it. Does nothing if given the null pointer. *) - PROCEDURE al_destroy_bitmap (Bitmap: ALLEGRO_BITMAPptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(* Blitting *) - -(* Draws an unscaled, unrotated bitmap at the given position to the current target bitmap. flags can be a combination of: -@unorderedlist( - @item(ALLEGRO_FLIP_HORIZONTAL - flip the bitmap about the y-axis) - @item(ALLEGRO_FLIP_VERTICAL - flip the bitmap about the x-axis) -) - Note: The current target bitmap must be a different bitmap. Drawing a bitmap to itself (or to a sub-bitmap of itself) or drawing a sub-bitmap to its parent (or another sub-bitmap of its parent) are not currently supported. To copy part of a bitmap into the same bitmap simply use a temporary bitmap instead. - - Note: The backbuffer (or a sub-bitmap thereof) can not be transformed, blended or tinted. If you need to draw the backbuffer draw it to a temporary bitmap first with no active transformation (except translation). Blending and tinting settings/parameters will be ignored. This does not apply when drawing into a memory bitmap. - @seealso(al_set_target_bitmap) @seealso(al_draw_bitmap_region) @seealso(al_draw_scaled_bitmap) @seealso(al_draw_rotated_bitmap) @seealso(al_draw_scaled_rotated_bitmap) - *) - PROCEDURE al_draw_bitmap (bitmap: ALLEGRO_BITMAPptr; dx, dy: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Draws a region of the given bitmap to the target bitmap. - @param(sx source x) - @param(sy source y) - @param(sw source width @(width of region to blit@)) - @param(sh source height @(height of region to blit@)) - @param(dx destination x) - @param(dy destination y) - @param(flags same as for al_draw_bitmap) - @seealso(al_draw_bitmap) @seealso(al_draw_scaled_bitmap) @seealso(al_draw_rotated_bitmap) @seealso(al_draw_scaled_rotated_bitmap) - *) - PROCEDURE al_draw_bitmap_region (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh, dx, dy: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Draws a scaled version of the given bitmap to the target bitmap. - @param(sx source x) - @param(sy source y) - @param(sw source width) - @param(sh source height) - @param(dx destination x) - @param(dy destination y) - @param(dw destination width) - @param(dh destination height) - @param(flags same as for al_draw_bitmap) - @seealso(al_draw_bitmap) @seealso(al_draw_bitmap_region) @seealso(al_draw_rotated_bitmap) @seealso(al_draw_scaled_rotated_bitmap) - *) - PROCEDURE al_draw_scaled_bitmap (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh, dx, dy, dw, dh: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Draws a rotated version of the given bitmap to the target bitmap. - Example: -@longcode(# -VAR - w, h: SINGLE; -BEGIN - w := al_get_bitmap_width (bitmap); - h := al_get_bitmap_height (bitmap); - al_draw_rotated_bitmap (bitmap, w / 2, h / 2, x, y, ALLEGRO_PI / 2, 0); -#) - The above code draws the bitmap centered on x/y and rotates it 90° clockwise. - @param(cx center x @(relative to the left of bitmap@)) - @param(cy center y @(relative to the top or bitmap@)) - @param(dx destination x) - @param(dy destination y) - @param(angle angle in radians by which to rotate clockwise) - @param(flags same as for al_draw_bitmap) - @seealso(al_draw_bitmap) @seealso(al_draw_bitmap_region) @seealso(al_draw_scaled_bitmap) @seealso(al_draw_scaled_rotated_bitmap) - *) - PROCEDURE al_draw_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; cx, cy, dx, dy, angle: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Like @link(al_draw_rotated_bitmap), but can also scale the bitmap. - - The point at cx/cy in the bitmap will be drawn at dx/dy and the bitmap is rotated and scaled around this point. - @param(cx center x @(relative to the left of bitmap@)) - @param(cy center y @(relative to the top or bitmap@)) - @param(dx destination x) - @param(dy destination y) - @param(xscale how much to scale on the x-axis @(e.g. 2 for twice the size@)) - @param(yscale how much to scale on the y-axis) - @param(angle angle in radians by which to rotate clockwise) - @param(flags same as for al_draw_bitmap) - @seealso(al_draw_bitmap) @seealso(al_draw_bitmap_region) @seealso(al_draw_scaled_bitmap) - *) - PROCEDURE al_draw_scaled_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(* Tinted blitting *) - PROCEDURE al_draw_tinted_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; dx, dy: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_draw_tinted_bitmap_region (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; sx, sy, sw, sh, dx, dy: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_draw_tinted_scaled_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; sx, sy, sw, sh, dx, dy, dw, dh: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Like @link(al_draw_rotated_bitmap) but multiplies all colors in the bitmap with the given color. - @seealso(al_draw_tinted_bitmap) - *) - PROCEDURE al_draw_tinted_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; cx, cy, dx, dy, angle: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_draw_tinted_scaled_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_draw_tinted_scaled_rotated_bitmap_region (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh: AL_FLOAT; tint: ALLEGRO_COLOR; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(* Locking *) - FUNCTION al_lock_bitmap (bitmap: ALLEGRO_BITMAPptr; format: ALLEGRO_PIXEL_FORMAT; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_lock_bitmap_region (bitmap: ALLEGRO_BITMAPptr; x, y, width, height: AL_INT; format: ALLEGRO_PIXEL_FORMAT; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_unlock_bitmap (bitmap: ALLEGRO_BITMAPptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - - PROCEDURE al_put_pixel (x, y: AL_INT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_put_blended_pixel (x, y: AL_INT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_pixel (bitmap: ALLEGRO_BITMAPptr; x, y: AL_INT): ALLEGRO_COLOR; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_pixel_size (format: ALLEGRO_PIXEL_FORMAT): AL_INT; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Pixel mapping *) - FUNCTION al_map_rgb (r, g, b: AL_UCHAR): ALLEGRO_COLOR; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_map_rgba (r, g, b, a: AL_UCHAR): ALLEGRO_COLOR; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_map_rgb_f (r, g, b: AL_FLOAT): ALLEGRO_COLOR; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_map_rgba_f (r, g, b, a: AL_FLOAT): ALLEGRO_COLOR; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Pixel unmapping *) - PROCEDURE al_unmap_rgb (color: ALLEGRO_COLOR; VAR r, g, b: AL_UCHAR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_unmap_rgba (color: ALLEGRO_COLOR; VAR r, g, b, a: AL_UCHAR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_unmap_rgb_f (color: ALLEGRO_COLOR; VAR r, g, b: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_unmap_rgba_f (color: ALLEGRO_COLOR; VAR r, g, b, a: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_pixel_format_bits (format: AL_INT): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Masking *) - PROCEDURE al_convert_mask_to_alpha (bitmap: ALLEGRO_BITMAPptr; mask_color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Clipping *) - PROCEDURE al_set_clipping_rectangle (x, y, width, height: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_restore_clipping_rectangle; CDECL - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_get_clipping_rectangle (VAR x, y, w, h: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Sub bitmaps *) - FUNCTION al_create_sub_bitmap (parent: ALLEGRO_BITMAPptr; x, y, w, h: AL_INT): ALLEGRO_BITMAPptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_is_sub_bitmap (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_parent_bitmap (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_BITMAPptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Miscellaneous *) - FUNCTION al_clone_bitmap (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_BITMAPptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_is_bitmap_locked (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Blending *) - PROCEDURE al_set_blender (op: ALLEGRO_BLEND_OPERATIONS; source, dest: ALLEGRO_BLEND_MODE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_get_blender (VAR op: ALLEGRO_BLEND_OPERATIONS; VAR source, dest: ALLEGRO_BLEND_MODE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_separate_blender (op: ALLEGRO_BLEND_OPERATIONS; source, dest: ALLEGRO_BLEND_MODE; - alpha_op: ALLEGRO_BLEND_OPERATIONS; alpha_source, alpha_dest: ALLEGRO_BLEND_MODE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_get_separate_blender (VAR op: ALLEGRO_BLEND_OPERATIONS; VAR source, dest: ALLEGRO_BLEND_MODE; - VAR alpha_op: ALLEGRO_BLEND_OPERATIONS; VAR alpha_source, alpha_dest: ALLEGRO_BLEND_MODE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - PROCEDURE _al_put_pixel (bitmap: ALLEGRO_BITMAPptr; x,y: AL_INT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * file.h - ***************) - -{ TODO: - Actually, this header is needed by Allegro to define new loaders and savers, - but at the moment I'll not add it. } - - - -(****************************************************************************** - * bitmap_io.h * - ***************) - -{ TODO: Some functions need the file.h definitions. } - - FUNCTION al_load_bitmap (CONST filename: STRING): ALLEGRO_BITMAPptr; INLINE; - FUNCTION al_save_bitmap (CONST filename: STRING; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; INLINE; - - - -(****************************************************************************** - * display.h * - *************) - - - CONST - ALLEGRO_DEFAULT_DISPLAY_ADAPTER = -1; - (* Possible bit combinations for the flags parameter of al_set_new_display_flags. *) - ALLEGRO_DEFAULT = 0 SHL 0; - ALLEGRO_WINDOWED = 1 SHL 0; - ALLEGRO_FULLSCREEN = 1 SHL 1; - ALLEGRO_OPENGL = 1 SHL 2; - ALLEGRO_DIRECT3D_INTERNAL = 1 SHL 3; - ALLEGRO_RESIZABLE = 1 SHL 4; - ALLEGRO_NOFRAME = 1 SHL 5; - ALLEGRO_GENERATE_EXPOSE_EVENTS = 1 SHL 6; - ALLEGRO_OPENGL_3_0 = 1 SHL 7; - ALLEGRO_OPENGL_FORWARD_COMPATIBLE = 1 SHL 8; - ALLEGRO_FULLSCREEN_WINDOW = 1 SHL 9; - ALLEGRO_MINIMIZED = 1 SHL 10; - - TYPE - (* Possible parameters for al_set_display_option. - * Make sure to update ALLEGRO_EXTRA_DISPLAY_SETTINGS if you modify - * anything here. - *) - ALLEGRO_DISPLAY_OPTIONS = ( - ALLEGRO_RED_SIZE, - ALLEGRO_GREEN_SIZE, - ALLEGRO_BLUE_SIZE, - ALLEGRO_ALPHA_SIZE, - ALLEGRO_RED_SHIFT, - ALLEGRO_GREEN_SHIFT, - ALLEGRO_BLUE_SHIFT, - ALLEGRO_ALPHA_SHIFT, - ALLEGRO_ACC_RED_SIZE, - ALLEGRO_ACC_GREEN_SIZE, - ALLEGRO_ACC_BLUE_SIZE, - ALLEGRO_ACC_ALPHA_SIZE, - ALLEGRO_STEREO, - ALLEGRO_AUX_BUFFERS, - ALLEGRO_COLOR_SIZE, - ALLEGRO_DEPTH_SIZE, - ALLEGRO_STENCIL_SIZE, - ALLEGRO_SAMPLE_BUFFERS, - ALLEGRO_SAMPLES, - ALLEGRO_RENDER_METHOD, - ALLEGRO_FLOAT_COLOR, - ALLEGRO_FLOAT_DEPTH, - ALLEGRO_SINGLE_BUFFER, - ALLEGRO_SWAP_METHOD, - ALLEGRO_COMPATIBLE_DISPLAY, - ALLEGRO_UPDATE_DISPLAY_REGION, - ALLEGRO_VSYNC, - ALLEGRO_MAX_BITMAP_SIZE, - ALLEGRO_SUPPORT_NPOT_BITMAP, - ALLEGRO_CAN_DRAW_INTO_BITMAP, - ALLEGRO_SUPPORT_SEPARATE_ALPHA, - ALLEGRO_DISPLAY_OPTIONS_COUNT - ); - - CONST - ALLEGRO_DONTCARE = 0; - ALLEGRO_REQUIRE = 1; - ALLEGRO_SUGGEST = 2; - - TYPE - ALLEGRO_DISPLAY_ORIENTATION = ( - ALLEGRO_DISPLAY_ORIENTATION_0_DEGREES, - ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES, - ALLEGRO_DISPLAY_ORIENTATION_180_DEGREES, - ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES, - ALLEGRO_DISPLAY_ORIENTATION_FACE_UP, - ALLEGRO_DISPLAY_ORIENTATION_FACE_DOWN - ); - - - - ALLEGRO_DISPLAYptr = AL_POINTER; - - - - ALLEGRO_DISPLAY_MODEptr = ^ALLEGRO_DISPLAY_MODE; - ALLEGRO_DISPLAY_MODE = RECORD - width, height, format, refresh_rate: AL_INT; - END; - - - - ALLEGRO_MONITOR_INFO = RECORD - x1, y1, x2, y2: AL_INT; - END; - - PROCEDURE al_set_new_display_refresh_rate (refresh_rate: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_new_display_flags (flags: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_new_display_refresh_rate: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_new_display_flags: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - - FUNCTION al_get_display_width (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_display_height (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_display_format (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_display_refresh_rate (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_display_flags (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_toggle_display_flag (display: ALLEGRO_DISPLAYptr; flag: AL_INT; onoff: AL_BOOL): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - - FUNCTION al_create_display (w, h: AL_INT): ALLEGRO_DISPLAYptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_destroy_display (display: ALLEGRO_DISPLAYptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_current_display: ALLEGRO_DISPLAYptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_target_bitmap (Bitmap: ALLEGRO_BITMAPptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_target_backbuffer (display: ALLEGRO_DISPLAYptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_backbuffer (display: ALLEGRO_DISPLAYptr): ALLEGRO_BITMAPptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_target_bitmap: ALLEGRO_BITMAPptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_acknowledge_resize (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_resize_display (display: ALLEGRO_DISPLAYptr; width, height: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_flip_display; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_update_display_region (x, y, Width, height: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_is_compatible_bitmap (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_num_display_modes: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_display_mode (index: AL_INT; mode: ALLEGRO_DISPLAY_MODEptr): ALLEGRO_DISPLAY_MODEptr; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_wait_for_vsync: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_display_event_source (display: ALLEGRO_DISPLAYptr): ALLEGRO_EVENT_SOURCEptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Primitives *) - PROCEDURE al_clear_to_color (color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_draw_pixel (x, y: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - PROCEDURE al_set_display_icon (display: ALLEGRO_DISPLAYptr; icon: ALLEGRO_BITMAPptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Stuff for multihead/window management *) - FUNCTION al_get_num_video_adapters: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_monitor_info (adapter: AL_INT; VAR info: ALLEGRO_MONITOR_INFO): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_new_display_adapter: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_new_display_adapter (adapter: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_new_window_position (x, y: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_get_new_window_position (VAR x, y: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_window_position (display: ALLEGRO_DISPLAYptr; x, y: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_get_window_position (display: ALLEGRO_DISPLAYptr; VAR x, y: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - PROCEDURE al_set_window_title (display: ALLEGRO_DISPLAYptr; CONST title: STRING); INLINE; - - PROCEDURE al_set_new_display_option (option: ALLEGRO_DISPLAY_OPTIONS; value, importance: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_new_display_option (option: ALLEGRO_DISPLAY_OPTIONS; VAR importance: AL_INT): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_reset_new_display_options; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_display_option (display: ALLEGRO_DISPLAYptr; option: ALLEGRO_DISPLAY_OPTIONS): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Deferred drawing *) - PROCEDURE al_hold_bitmap_drawing (hold: AL_BOOL); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_is_bitmap_drawing_held: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * keycodes.h * - **************) - -{$include keycodes.inc} - - - -(****************************************************************************** - * keyboard.h * - **************) - - TYPE - ALLEGRO_KEYBOARDptr = AL_POINTER; - - - ALLEGRO_KEYBOARD_STATEptr = ^ALLEGRO_KEYBOARD_STATE; - ALLEGRO_KEYBOARD_STATE = RECORD - display: ALLEGRO_DISPLAYptr; - { @exclude internal } - __key_down__internal__: ARRAY [0..((ALLEGRO_KEY_MAX * 31) DIV 32) - 1] OF AL_UINT; - END; - - FUNCTION al_is_keyboard_installed: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_install_keyboard: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_uninstall_keyboard; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_set_keyboard_leds (leds: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_keycode_to_name (keycode: AL_INT): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - PROCEDURE al_get_keyboard_state (VAR ret_state: ALLEGRO_KEYBOARD_STATE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_key_down (VAR state: ALLEGRO_KEYBOARD_STATE; keycode: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_keyboard_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * joystick.h * - **************) - - CONST -(* internal values *) - _AL_MAX_JOYSTICK_AXES = 3; - _AL_MAX_JOYSTICK_STICKS = 8; - _AL_MAX_JOYSTICK_BUTTONS = 32; - - TYPE - ALLEGRO_JOYSTICKptr = AL_POINTER; - - - - ALLEGRO_JOYSTICK_STATE = RECORD - stick: ARRAY [0.._AL_MAX_JOYSTICK_STICKS - 1] OF RECORD - axis: ARRAY [0.._AL_MAX_JOYSTICK_AXES - 1] OF AL_FLOAT; { -1.0 to 1.0 } - END; - button: ARRAY [0.._AL_MAX_JOYSTICK_BUTTONS - 1] OF AL_INT; { 0 to 32767 } - END; - - - - ALLEGRO_JOYFLAGS = ( - ALLEGRO_JOYFLAG_DIGITAL := $01, - ALLEGRO_JOYFLAG_ANALOGUE := $02 - ); - - FUNCTION al_install_joystick: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_uninstall_joystick; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_is_joystick_installed: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_reconfigure_joysticks: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_num_joysticks: AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick (joyn: AL_INT): ALLEGRO_JOYSTICKptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_release_joystick (j: ALLEGRO_JOYSTICKptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick_active (j: ALLEGRO_JOYSTICKptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick_name (j: ALLEGRO_JOYSTICKptr): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_joystick_num_sticks (j: ALLEGRO_JOYSTICKptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick_stick_flags (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick_stick_name (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_joystick_num_axes (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick_axis_name (j: ALLEGRO_JOYSTICKptr; stick, axis: AL_INT): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_joystick_num_buttons (j: ALLEGRO_JOYSTICKptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_joystick_button_name (j: ALLEGRO_JOYSTICKptr; buttonn: AL_INT): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - PROCEDURE al_get_joystick_state (j: ALLEGRO_JOYSTICKptr; VAR ret_state: ALLEGRO_JOYSTICK_STATE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_joystick_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * mouse.h * - ***********) - - CONST - (* Allow up to four extra axes for future expansion. *) - ALLEGRO_MOUSE_MAX_EXTRA_AXES = 4; - - TYPE - ALLEGRO_MOUSEptr = AL_POINTER; - - (* Type: ALLEGRO_MOUSE_STATE *) - ALLEGRO_MOUSE_STATEptr = ^ALLEGRO_MOUSE_STATE; - ALLEGRO_MOUSE_STATE = RECORD - (* (x, y) Primary mouse position - * (z) Mouse wheel position (1D 'wheel'), or, - * (w, z) Mouse wheel position (2D 'ball') - * display - the display the mouse is on (coordinates are relative to this) - * pressure - the pressure appleid to the mouse (for stylus/tablet) - *) - x, y, z, w: AL_INT; - more_axes: ARRAY [0..(ALLEGRO_MOUSE_MAX_EXTRA_AXES - 1)] OF AL_INT; - buttons: AL_INT; - pressure: AL_FLOAT; - display: ALLEGRO_DISPLAYptr; - END; - - - (* Mouse cursors *) - ALLEGRO_MOUSE_CURSORptr = AL_POINTER; - - ALLEGRO_SYSTEM_MOUSE_CURSOR = ( - ALLEGRO_SYSTEM_MOUSE_CURSOR_NONE := 0, - ALLEGRO_SYSTEM_MOUSE_CURSOR_DEFAULT := 1, - ALLEGRO_SYSTEM_MOUSE_CURSOR_ARROW := 2, - ALLEGRO_SYSTEM_MOUSE_CURSOR_BUSY := 3, - ALLEGRO_SYSTEM_MOUSE_CURSOR_QUESTION := 4, - ALLEGRO_SYSTEM_MOUSE_CURSOR_EDIT := 5, - ALLEGRO_SYSTEM_MOUSE_CURSOR_MOVE := 6, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_N := 7, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_W := 8, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_S := 9, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_E := 10, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_NW := 11, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_SW := 12, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_SE := 13, - ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_NE := 14, - ALLEGRO_SYSTEM_MOUSE_CURSOR_PROGRESS := 15, - ALLEGRO_SYSTEM_MOUSE_CURSOR_PRECISION := 16, - ALLEGRO_SYSTEM_MOUSE_CURSOR_LINK := 17, - ALLEGRO_SYSTEM_MOUSE_CURSOR_ALT_SELECT := 18, - ALLEGRO_SYSTEM_MOUSE_CURSOR_UNAVAILABLE := 19, - ALLEGRO_NUM_SYSTEM_MOUSE_CURSORS - ); - - FUNCTION al_is_mouse_installed: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_install_mouse: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_uninstall_mouse; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_mouse_num_buttons: AL_UINT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_mouse_num_axes: AL_UINT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_set_mouse_xy (display: ALLEGRO_DISPLAYptr; x, y: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_set_mouse_z (z: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_set_mouse_w (w: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_set_mouse_axis (axis, value: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_get_mouse_state (ret_state: ALLEGRO_MOUSE_STATEptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_mouse_button_down (CONST state: ALLEGRO_MOUSE_STATEptr; button: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_mouse_state_axis (CONST state: ALLEGRO_MOUSE_STATEptr; axis: AL_INT): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - FUNCTION al_get_mouse_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* - * Cursors: - * - * This will probably become part of the display API. It provides for - * hardware cursors only; software cursors may or may not be provided - * for later (it would need significant cooperation from the display - * API). - *) - FUNCTION al_create_mouse_cursor (sprite: ALLEGRO_BITMAPptr; xfocus, yfocus: AL_INT): ALLEGRO_MOUSE_CURSORptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_destroy_mouse_cursor (cursor: ALLEGRO_MOUSE_CURSORptr); - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_set_mouse_cursor (display: ALLEGRO_DISPLAYptr; cursor: ALLEGRO_MOUSE_CURSORptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_set_system_mouse_cursor (display: ALLEGRO_DISPLAYptr; cursor_id: ALLEGRO_SYSTEM_MOUSE_CURSOR): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_show_mouse_cursor (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_hide_mouse_cursor (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_mouse_cursor_position (VAR ret_x, ret_y: AL_INT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_grab_mouse (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_ungrab_mouse: AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * timer.h * - ***********) - -(* Converts microseconds to seconds. *) - FUNCTION ALLEGRO_USECS_TO_SECS (x: AL_DOUBLE): AL_DOUBLE; INLINE; - -(* Converts milliseconds to seconds. *) - FUNCTION ALLEGRO_MSECS_TO_SECS (x: AL_DOUBLE): AL_DOUBLE; INLINE; - -(* Converts beats per second to seconds. *) - FUNCTION ALLEGRO_BPS_TO_SECS (x: AL_DOUBLE): AL_DOUBLE; INLINE; - -(* Converts beats per minute to seconds. *) - FUNCTION ALLEGRO_BPM_TO_SECS (x: AL_DOUBLE): AL_DOUBLE; INLINE; - - TYPE - ALLEGRO_TIMERptr = POINTER; - - FUNCTION al_create_timer (speed_secs: AL_DOUBLE): ALLEGRO_TIMERptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_destroy_timer (timer: ALLEGRO_TIMERptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_start_timer (timer: ALLEGRO_TIMERptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_stop_timer (timer: ALLEGRO_TIMERptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_timer_started (CONST timer: ALLEGRO_TIMERptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_timer_speed (CONST timer: ALLEGRO_TIMERptr): AL_DOUBLE; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_timer_speed (timer: ALLEGRO_TIMERptr; speed_secs: AL_DOUBLE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_timer_count (CONST timer: ALLEGRO_TIMERptr): AL_INT64; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_timer_count (timer: ALLEGRO_TIMERptr; count: AL_INT64); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_add_timer_count (timer: ALLEGRO_TIMERptr; diff: AL_INT64); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_timer_event_source (timer: ALLEGRO_TIMERptr): ALLEGRO_EVENT_SOURCEptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * altime.h * - ************) - - TYPE - ALLEGRO_TIMEOUTptr = ^ALLEGRO_TIMEOUT; - (* This is an abstract data type representing a timer object. *) - ALLEGRO_TIMEOUT = RECORD - __pad1__, __pad2__: AL_INT64; - END; - - FUNCTION al_get_time: AL_DOUBLE; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_rest (seconds: AL_DOUBLE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* TODO: Change to VAR? *) - PROCEDURE al_init_timeout (timeout: ALLEGRO_TIMEOUTptr; seconds: AL_DOUBLE); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * events.h * - ************) - - TYPE - ALLEGRO_EVENT_TYPE = AL_UINT; - - CONST - ALLEGRO_EVENT_JOYSTICK_AXIS = 1; - ALLEGRO_EVENT_JOYSTICK_BUTTON_DOWN = 2; - ALLEGRO_EVENT_JOYSTICK_BUTTON_UP = 3; - ALLEGRO_EVENT_JOYSTICK_CONFIGURATION = 4; - - ALLEGRO_EVENT_KEY_DOWN = 10; - ALLEGRO_EVENT_KEY_CHAR = 11; - ALLEGRO_EVENT_KEY_UP = 12; - - ALLEGRO_EVENT_MOUSE_AXES = 20; - ALLEGRO_EVENT_MOUSE_BUTTON_DOWN = 21; - ALLEGRO_EVENT_MOUSE_BUTTON_UP = 22; - ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY = 23; - ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY = 24; - ALLEGRO_EVENT_MOUSE_WARPED = 25; - - ALLEGRO_EVENT_TIMER = 30; - - ALLEGRO_EVENT_DISPLAY_EXPOSE = 40; - ALLEGRO_EVENT_DISPLAY_RESIZE = 41; - ALLEGRO_EVENT_DISPLAY_CLOSE = 42; - ALLEGRO_EVENT_DISPLAY_LOST = 43; - ALLEGRO_EVENT_DISPLAY_FOUND = 44; - ALLEGRO_EVENT_DISPLAY_SWITCH_IN = 45; - ALLEGRO_EVENT_DISPLAY_SWITCH_OUT = 46; - ALLEGRO_EVENT_DISPLAY_ORIENTATION = 47; - -(* 1 <= n < 512 - builtin events - * 512 <= n < 1024 - reserved user events (for addons) - * 1024 <= n - unreserved user events - *) - FUNCTION ALLEGRO_EVENT_TYPE_IS_USER (t: ALLEGRO_EVENT_TYPE): AL_BOOL; INLINE; - -(* - * Event structures - * - * All event types have the following fields in common. - * - * _type -- the type of event this is - * timestamp -- when this event was generated - * source -- which event source generated this event - * - * For people writing event sources: The common fields must be at the - * very start of each event structure. - *) - TYPE - ALLEGRO_ANY_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_EVENT_SOURCEptr; - timestamp : AL_DOUBLE; - END; - - ALLEGRO_DISPLAY_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_DISPLAYptr; - timestamp : AL_DOUBLE; - x : AL_INT; - y : AL_INT; - width : AL_INT; - height : AL_INT; - orientation : AL_INT; - END; - - ALLEGRO_JOYSTICK_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_JOYSTICKptr; - timestamp : AL_DOUBLE; - id : ALLEGRO_JOYSTICKptr; - stick : AL_INT; - axis : AL_INT; - pos : AL_FLOAT; - button : AL_INT; - END; - - ALLEGRO_KEYBOARD_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_KEYBOARDptr; - timestamp : AL_DOUBLE; - display : ALLEGRO_DISPLAYptr; - keycode : AL_INT; - unichar : AL_INT; - modifiers : AL_UINT; - _repeat : AL_BOOL; - END; - - ALLEGRO_MOUSE_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_MOUSEptr; - timestamp : AL_DOUBLE; - display : ALLEGRO_DISPLAYptr; - x, y, z, w : AL_INT; - dx, dy, dz, dw : AL_INT; - button : AL_UINT; - pressure : AL_FLOAT; - END; - - ALLEGRO_TIMER_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_TIMERptr; - timestamp : AL_DOUBLE; - count : AL_INT64; - error : AL_DOUBLE; - END; - - ALLEGRO_USER_EVENT_DESCRIPTORptr = POINTER; - - ALLEGRO_USER_EVENTptr = ^ALLEGRO_USER_EVENT; - ALLEGRO_USER_EVENT = RECORD - _type : ALLEGRO_EVENT_TYPE; - source : ALLEGRO_EVENT_SOURCEptr; - timestamp : AL_DOUBLE; - __internal__descr : ALLEGRO_USER_EVENT_DESCRIPTORptr; - data1 : AL_POINTER; - data2 : AL_POINTER; - data3 : AL_POINTER; - data4 : AL_POINTER; - END; - - ALLEGRO_EVENTptr = ^ALLEGRO_EVENT; - - ALLEGRO_EVENT = RECORD - case LONGINT OF - (* This must be the same as the first field of _AL_EVENT_HEADER. *) - 0 : ( _type : ALLEGRO_EVENT_TYPE ); - (* `any' is to allow the user to access the other fields which are - * common to all event types, without using some specific type - * structure. - *) - 1 : ( any : ALLEGRO_ANY_EVENT ); - 2 : ( display : ALLEGRO_DISPLAY_EVENT ); - 3 : ( joystick : ALLEGRO_JOYSTICK_EVENT ); - 4 : ( keyboard : ALLEGRO_KEYBOARD_EVENT ); - 5 : ( mouse : ALLEGRO_MOUSE_EVENT ); - 6 : ( timer : ALLEGRO_TIMER_EVENT ); - 7 : ( user : ALLEGRO_USER_EVENT ); - END; - - ALLEGRO_EVENT_DTOR_PROC = PROCEDURE (evt: ALLEGRO_USER_EVENTptr); CDECL; - -(* Event sources *) - PROCEDURE al_init_user_event_source (source: ALLEGRO_EVENT_SOURCEptr); CDECL; { TODO: Use VAR parameter? } - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_destroy_user_event_source (source: ALLEGRO_EVENT_SOURCEptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* The second argument is ALLEGRO_EVENT instead of ALLEGRO_USER_EVENT - * to prevent users passing a pointer to a too-short structure. - *) - FUNCTION al_emit_user_event (source: ALLEGRO_EVENT_SOURCEptr; Event: ALLEGRO_EVENTptr; dtor: ALLEGRO_EVENT_DTOR_PROC): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_unref_user_event (event: ALLEGRO_USER_EVENTptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_set_event_source_data (source: ALLEGRO_EVENT_SOURCEptr; data: AL_POINTER); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_event_source_data (CONST source: ALLEGRO_EVENT_SOURCEptr): AL_POINTER; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - TYPE - ALLEGRO_EVENT_QUEUEptr = AL_POINTER; - - FUNCTION al_create_event_queue: ALLEGRO_EVENT_QUEUEptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_destroy_event_queue (queue: ALLEGRO_EVENT_QUEUEptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_register_event_source (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_unregister_event_source (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_is_event_queue_empty (queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_next_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_peek_next_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_drop_next_event (queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_flush_event_queue (queue: ALLEGRO_EVENT_QUEUEptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_wait_for_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_wait_for_event_timed (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT; secs: AL_FLOAT): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_wait_for_event_until (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT; timeout: ALLEGRO_TIMEOUTptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * transformations.h * - *********************) - - TYPE - ALLEGRO_TRANSFORMptr = ^ALLEGRO_TRANSFORM; - ALLEGRO_TRANSFORM = RECORD - m: ARRAY [0..3] OF ARRAY [0..3] OF AL_FLOAT; - END; - -(* Transformations*) - PROCEDURE al_use_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_copy_transform (OUT dest: ALLEGRO_TRANSFORM; VAR src: ALLEGRO_TRANSFORM); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_identity_transform (OUT trans: ALLEGRO_TRANSFORM); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_build_transform (OUT trans: ALLEGRO_TRANSFORM; x, y, sx, sy, theta: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_translate_transform (VAR trans: ALLEGRO_TRANSFORM; x, y: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_rotate_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_scale_transform (VAR trans: ALLEGRO_TRANSFORM; sx, sy: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_transform_coordinates (VAR trans: ALLEGRO_TRANSFORM; VAR x, y: AL_FLOAT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_compose_transform (VAR trans, other: ALLEGRO_TRANSFORM); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_get_current_transform: ALLEGRO_TRANSFORMptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_invert_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_check_inverse (VAR trans: ALLEGRO_TRANSFORM; tol: AL_FLOAT): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * utf8.h * - **********) - - {TODO: Documentation says it's not needed as it's used internally. - Only basic functionality is implemented for convenience. - - Use of WIDESTRING and UTFSTRING is recommendable. } - - TYPE - _al_tagbstring = RECORD - mlen, slen: AL_INT; - data: AL_VOIDptr; - END; - - - - ALLEGRO_USTRptr = ^ALLEGRO_USTR; - ALLEGRO_USTR = _al_tagbstring; - - - - ALLEGRO_USTR_INFOptr = ^ALLEGRO_USTR_INFO; - ALLEGRO_USTR_INFO = _al_tagbstring; - -(* Creating strings *) - FUNCTION al_ustr_new (CONST s: STRING): ALLEGRO_USTRptr; INLINE; - FUNCTION al_ustr_new_from_buffer (CONST s: AL_STRptr; size: AL_SIZE_T): ALLEGRO_USTRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_ustr_free (us: ALLEGRO_USTRptr); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_cstr (CONST us: ALLEGRO_USTRptr): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - PROCEDURE al_ustr_to_buffer (CONST us: ALLEGRO_USTRptr; buffer: AL_STRptr; size: AL_INT); CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_cstr_dup (CONST us: ALLEGRO_USTRptr): AL_STRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_ustr_dup (CONST us: ALLEGRO_USTRptr): ALLEGRO_USTRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_ustr_dup_substr (CONST us: ALLEGRO_USTRptr; start_pos, end_pos: AL_INT): ALLEGRO_USTRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - -(* Assign *) - FUNCTION al_ustr_assign (us1: ALLEGRO_USTRptr; CONST us2: ALLEGRO_USTRptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_ustr_assign_cstr (us1: ALLEGRO_USTRptr; CONST s: STRING): AL_BOOL; INLINE; - -(* Compare *) - FUNCTION al_ustr_equal (CONST us1, us2: ALLEGRO_USTRptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_ustr_compare (CONST u, v: ALLEGRO_USTRptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - FUNCTION al_ustr_ncompare (CONST u, v: ALLEGRO_USTRptr): AL_INT; CDECL; - EXTERNAL ALLEGRO_LIB_NAME; - - - -(****************************************************************************** - * tls.h - * Thread local storage routines. - *********) - - TYPE - ALLEGRO_STATE_FLAGS = ( - ALLEGRO_STATE_NEW_DISPLAY_PARAMETERS := $0001, - ALLEGRO_STATE_NEW_BITMAP_PARAMETERS := $0002, - ALLEGRO_STATE_DISPLAY := $0004, - ALLEGRO_STATE_TARGET_BITMAP := $0008, - ALLEGRO_STATE_BITMAP := $000A, {= 512; - END; - - - -(****************************************************************************** - * utf8.h * - **********) - - FUNCTION _al_ustr_new_ (CONST s: AL_STRptr): ALLEGRO_USTRptr; CDECL; - EXTERNAL ALLEGRO_LIB_NAME NAME 'al_ustr_new'; - - FUNCTION al_ustr_new (CONST s: STRING): ALLEGRO_USTRptr; - BEGIN - al_ustr_new := _al_ustr_new_ (AL_STRptr (s)); - END; - - - - FUNCTION _al_ustr_assign_cstr_ (us1: ALLEGRO_USTRptr; CONST s: AL_STRptr): AL_BOOL; CDECL; - EXTERNAL ALLEGRO_LIB_NAME NAME 'al_ustr_assign_cstr'; - - FUNCTION al_ustr_assign_cstr (us1: ALLEGRO_USTRptr; CONST s: STRING): AL_BOOL; - BEGIN - al_ustr_assign_cstr := _al_ustr_assign_cstr_ (us1, AL_STRptr (s)); - END; - -INITIALIZATION -{ Delphi forces an INITIALIZATION section if FINALIZATION is used. } - ; -{ Suggested by FPC mailing list user. } - -{ $if defined(cpui386) or defined(cpux86_64)} -{ SetExceptionMask(GetExceptionMask + [exZeroDivide, exInvalidOp]); } -{ $ENDIF} - -FINALIZATION -{ Ensures that we call it, as Pascal hasn't an "atexit" function. } - al_uninstall_system; -END. diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/allegro5.ppu b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/allegro5.ppu deleted file mode 100644 index 51de8d99..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/allegro5.ppu and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/keycodes.inc b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/keycodes.inc deleted file mode 100644 index 5c760df9..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/keycodes.inc +++ /dev/null @@ -1,158 +0,0 @@ -CONST -(* Key scan-code identifiers. - Note these values are deliberately the same as in Allegro 4.1.x *) - ALLEGRO_KEY_A = 1; - ALLEGRO_KEY_B = 2; - ALLEGRO_KEY_C = 3; - ALLEGRO_KEY_D = 4; - ALLEGRO_KEY_E = 5; - ALLEGRO_KEY_F = 6; - ALLEGRO_KEY_G = 7; - ALLEGRO_KEY_H = 8; - ALLEGRO_KEY_I = 9; - ALLEGRO_KEY_J = 10; - ALLEGRO_KEY_K = 11; - ALLEGRO_KEY_L = 12; - ALLEGRO_KEY_M = 13; - ALLEGRO_KEY_N = 14; - ALLEGRO_KEY_O = 15; - ALLEGRO_KEY_P = 16; - ALLEGRO_KEY_Q = 17; - ALLEGRO_KEY_R = 18; - ALLEGRO_KEY_S = 19; - ALLEGRO_KEY_T = 20; - ALLEGRO_KEY_U = 21; - ALLEGRO_KEY_V = 22; - ALLEGRO_KEY_W = 23; - ALLEGRO_KEY_X = 24; - ALLEGRO_KEY_Y = 25; - ALLEGRO_KEY_Z = 26; - - ALLEGRO_KEY_0 = 27; - ALLEGRO_KEY_1 = 28; - ALLEGRO_KEY_2 = 29; - ALLEGRO_KEY_3 = 30; - ALLEGRO_KEY_4 = 31; - ALLEGRO_KEY_5 = 32; - ALLEGRO_KEY_6 = 33; - ALLEGRO_KEY_7 = 34; - ALLEGRO_KEY_8 = 35; - ALLEGRO_KEY_9 = 36; - - ALLEGRO_KEY_PAD_0 = 37; - ALLEGRO_KEY_PAD_1 = 38; - ALLEGRO_KEY_PAD_2 = 39; - ALLEGRO_KEY_PAD_3 = 40; - ALLEGRO_KEY_PAD_4 = 41; - ALLEGRO_KEY_PAD_5 = 42; - ALLEGRO_KEY_PAD_6 = 43; - ALLEGRO_KEY_PAD_7 = 44; - ALLEGRO_KEY_PAD_8 = 45; - ALLEGRO_KEY_PAD_9 = 46; - - ALLEGRO_KEY_F1 = 47; - ALLEGRO_KEY_F2 = 48; - ALLEGRO_KEY_F3 = 49; - ALLEGRO_KEY_F4 = 50; - ALLEGRO_KEY_F5 = 51; - ALLEGRO_KEY_F6 = 52; - ALLEGRO_KEY_F7 = 53; - ALLEGRO_KEY_F8 = 54; - ALLEGRO_KEY_F9 = 55; - ALLEGRO_KEY_F10 = 56; - ALLEGRO_KEY_F11 = 57; - ALLEGRO_KEY_F12 = 58; - - ALLEGRO_KEY_ESCAPE = 59; - ALLEGRO_KEY_TILDE = 60; - ALLEGRO_KEY_MINUS = 61; - ALLEGRO_KEY_EQUALS = 62; - ALLEGRO_KEY_BACKSPACE = 63; - ALLEGRO_KEY_TAB = 64; - ALLEGRO_KEY_OPENBRACE = 65; - ALLEGRO_KEY_CLOSEBRACE = 66; - ALLEGRO_KEY_ENTER = 67; - ALLEGRO_KEY_COLON = 68; - ALLEGRO_KEY_QUOTE = 69; - ALLEGRO_KEY_BACKSLASH = 70; - ALLEGRO_KEY_BACKSLASH2 = 71; { DirectInput calls this DIK_OEM_102: "< > | on UK/Germany keyboards" } - ALLEGRO_KEY_COMMA = 72; - ALLEGRO_KEY_STOP = 73; - ALLEGRO_KEY_SLASH = 74; - ALLEGRO_KEY_SPACE = 75; - - ALLEGRO_KEY_INSERT = 76; - ALLEGRO_KEY_DEL = 77; - ALLEGRO_KEY_HOME = 78; - ALLEGRO_KEY_END = 79; - ALLEGRO_KEY_PGUP = 80; - ALLEGRO_KEY_PGDN = 81; - ALLEGRO_KEY_LEFT = 82; - ALLEGRO_KEY_RIGHT = 83; - ALLEGRO_KEY_UP = 84; - ALLEGRO_KEY_DOWN = 85; - - ALLEGRO_KEY_PAD_SLASH = 86; - ALLEGRO_KEY_PAD_ASTERISK = 87; - ALLEGRO_KEY_PAD_MINUS = 88; - ALLEGRO_KEY_PAD_PLUS = 89; - ALLEGRO_KEY_PAD_DELETE = 90; - ALLEGRO_KEY_PAD_ENTER = 91; - - ALLEGRO_KEY_PRINTSCREEN = 92; - ALLEGRO_KEY_PAUSE = 93; - - ALLEGRO_KEY_ABNT_C1 = 94; - ALLEGRO_KEY_YEN = 95; - ALLEGRO_KEY_KANA = 96; - ALLEGRO_KEY_CONVERT = 97; - ALLEGRO_KEY_NOCONVERT = 98; - ALLEGRO_KEY_AT = 99; - ALLEGRO_KEY_CIRCUMFLEX = 100; - ALLEGRO_KEY_COLON2 = 101; - ALLEGRO_KEY_KANJI = 102; - - ALLEGRO_KEY_PAD_EQUALS = 103; { MacOS X } - ALLEGRO_KEY_BACKQUOTE = 104; { MacOS X } - ALLEGRO_KEY_SEMICOLON2 = 105; { MacOS X -- TODO: ask lillo what this should be } - ALLEGRO_KEY_COMMAND = 106; { MacOS X } - ALLEGRO_KEY_UNKNOWN = 107; - - { All codes up to before ALLEGRO_KEY_MODIFIERS can be freely - assignedas additional unknown keys, like various multimedia - and application keys keyboards may have. - } - - ALLEGRO_KEY_MODIFIERS = 215; - - ALLEGRO_KEY_LSHIFT = 215; - ALLEGRO_KEY_RSHIFT = 216; - ALLEGRO_KEY_LCTRL = 217; - ALLEGRO_KEY_RCTRL = 218; - ALLEGRO_KEY_ALT = 219; - ALLEGRO_KEY_ALTGR = 220; - ALLEGRO_KEY_LWIN = 221; - ALLEGRO_KEY_RWIN = 222; - ALLEGRO_KEY_MENU = 223; - ALLEGRO_KEY_SCROLLLOCK = 224; - ALLEGRO_KEY_NUMLOCK = 225; - ALLEGRO_KEY_CAPSLOCK = 226; - - ALLEGRO_KEY_MAX = 227; - -{ Shift keys flags. } - ALLEGRO_KEYMOD_SHIFT = $0001; - ALLEGRO_KEYMOD_CTRL = $0002; - ALLEGRO_KEYMOD_ALT = $0004; - ALLEGRO_KEYMOD_LWIN = $0008; - ALLEGRO_KEYMOD_RWIN = $0010; - ALLEGRO_KEYMOD_MENU = $0020; - ALLEGRO_KEYMOD_COMMAND = $0040; - ALLEGRO_KEYMOD_SCROLOCK = $0100; - ALLEGRO_KEYMOD_NUMLOCK = $0200; - ALLEGRO_KEYMOD_CAPSLOCK = $0400; - ALLEGRO_KEYMOD_INALTSEQ = $0800; - ALLEGRO_KEYMOD_ACCENT1 = $1000; - ALLEGRO_KEYMOD_ACCENT2 = $2000; - ALLEGRO_KEYMOD_ACCENT3 = $4000; - ALLEGRO_KEYMOD_ACCENT4 = $8000; diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5acodec.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5acodec.a deleted file mode 100644 index 9d4e8578..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5acodec.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5audio.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5audio.a deleted file mode 100644 index f2888dcf..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5audio.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5base.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5base.a deleted file mode 100644 index acf2b8a1..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5base.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5font.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5font.a deleted file mode 100644 index 012dd369..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5font.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5image.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5image.a deleted file mode 100644 index af194964..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5image.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5primitives.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5primitives.a deleted file mode 100644 index bb44556f..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5primitives.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5ttf.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5ttf.a deleted file mode 100644 index 326bf383..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpal5ttf.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpallegro5.a b/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpallegro5.a deleted file mode 100644 index 0fd9eaf0..00000000 Binary files a/sample/pascal-master/spaceShip/allegro-pas.5.0/lib/libpallegro5.a and /dev/null differ diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/make.sh b/sample/pascal-master/spaceShip/allegro-pas.5.0/make.sh deleted file mode 100644 index 250201a1..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/make.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# FLAGS='-O3 -Xs- -XX' -# FLAGS='-dDEBUGMODE -g' -FLAGS='-g' -DIRS='-Fulib -FUobj -FEexamples' -fpc $FLAGS $DIRS examples/test.pas -fpc $FLAGS $DIRS examples/ex_audio_simple.pas -fpc $FLAGS $DIRS examples/ex_blit.pas -fpc $FLAGS $DIRS examples/ex_font.pas -fpc $FLAGS $DIRS examples/ex_gldepth.pas -fpc $FLAGS $DIRS examples/ex_haiku.pas -fpc $FLAGS $DIRS examples/ex_lines.pas -fpc $FLAGS $DIRS examples/ex_prim.pas -fpc $FLAGS $DIRS examples/ex_rotate.pas -fpc $FLAGS $DIRS examples/ex_scale.pas -fpc $FLAGS $DIRS examples/ex_transform.pas -fpc $FLAGS $DIRS examples/ex_warp_mouse.pas - diff --git a/sample/pascal-master/spaceShip/allegro-pas.5.0/obj/dir.txt b/sample/pascal-master/spaceShip/allegro-pas.5.0/obj/dir.txt deleted file mode 100644 index 18f7a672..00000000 --- a/sample/pascal-master/spaceShip/allegro-pas.5.0/obj/dir.txt +++ /dev/null @@ -1 +0,0 @@ -This file is needed because some unzip programs skip empty directories. diff --git a/sample/pascal-master/spaceShip/alterebro-pixel-font.ttf b/sample/pascal-master/spaceShip/alterebro-pixel-font.ttf deleted file mode 100644 index b47b3634..00000000 Binary files a/sample/pascal-master/spaceShip/alterebro-pixel-font.ttf and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid-icon.png b/sample/pascal-master/spaceShip/asteroid-icon.png deleted file mode 100644 index 4cdd8224..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid-icon.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid.png b/sample/pascal-master/spaceShip/asteroid.png deleted file mode 100644 index bdaa7088..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid/asteroid1.png b/sample/pascal-master/spaceShip/asteroid/asteroid1.png deleted file mode 100644 index 43c01bb2..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid/asteroid1.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid/asteroid2.png b/sample/pascal-master/spaceShip/asteroid/asteroid2.png deleted file mode 100644 index ebb4633e..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid/asteroid2.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid/asteroid3.png b/sample/pascal-master/spaceShip/asteroid/asteroid3.png deleted file mode 100644 index 9fe3d137..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid/asteroid3.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid1.png b/sample/pascal-master/spaceShip/asteroid1.png deleted file mode 100644 index 43c01bb2..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid1.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid2.png b/sample/pascal-master/spaceShip/asteroid2.png deleted file mode 100644 index ebb4633e..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid2.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/asteroid3.png b/sample/pascal-master/spaceShip/asteroid3.png deleted file mode 100644 index 9fe3d137..00000000 Binary files a/sample/pascal-master/spaceShip/asteroid3.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/blue-ball.png b/sample/pascal-master/spaceShip/blue-ball.png deleted file mode 100644 index 1ac1f5fa..00000000 Binary files a/sample/pascal-master/spaceShip/blue-ball.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/bullet.ogg b/sample/pascal-master/spaceShip/bullet.ogg deleted file mode 100644 index cd3f46c8..00000000 Binary files a/sample/pascal-master/spaceShip/bullet.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/bullet.wav b/sample/pascal-master/spaceShip/bullet.wav deleted file mode 100644 index 4cb47a6c..00000000 Binary files a/sample/pascal-master/spaceShip/bullet.wav and /dev/null differ diff --git a/sample/pascal-master/spaceShip/bullet1.png b/sample/pascal-master/spaceShip/bullet1.png deleted file mode 100644 index 751b9eb4..00000000 Binary files a/sample/pascal-master/spaceShip/bullet1.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/c.png b/sample/pascal-master/spaceShip/c.png deleted file mode 100644 index 9fb175b1..00000000 Binary files a/sample/pascal-master/spaceShip/c.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/exp.png b/sample/pascal-master/spaceShip/exp.png deleted file mode 100644 index 7ef38550..00000000 Binary files a/sample/pascal-master/spaceShip/exp.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-0.png b/sample/pascal-master/spaceShip/explosion/exp-0.png deleted file mode 100644 index 75ad3e28..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-0.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-1.png b/sample/pascal-master/spaceShip/explosion/exp-1.png deleted file mode 100644 index b216b16b..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-1.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-10.png b/sample/pascal-master/spaceShip/explosion/exp-10.png deleted file mode 100644 index bc01b3a8..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-10.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-11.png b/sample/pascal-master/spaceShip/explosion/exp-11.png deleted file mode 100644 index 1dff19df..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-11.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-12.png b/sample/pascal-master/spaceShip/explosion/exp-12.png deleted file mode 100644 index 700b8064..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-12.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-13.png b/sample/pascal-master/spaceShip/explosion/exp-13.png deleted file mode 100644 index d499ad85..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-13.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-14.png b/sample/pascal-master/spaceShip/explosion/exp-14.png deleted file mode 100644 index 008253f5..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-14.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-15.png b/sample/pascal-master/spaceShip/explosion/exp-15.png deleted file mode 100644 index 6009551f..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-15.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-16.png b/sample/pascal-master/spaceShip/explosion/exp-16.png deleted file mode 100644 index 31cf7088..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-16.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-2.png b/sample/pascal-master/spaceShip/explosion/exp-2.png deleted file mode 100644 index a35bfdb7..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-2.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-3.png b/sample/pascal-master/spaceShip/explosion/exp-3.png deleted file mode 100644 index 8eabfd23..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-3.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-4.png b/sample/pascal-master/spaceShip/explosion/exp-4.png deleted file mode 100644 index a421aa6e..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-4.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-5.png b/sample/pascal-master/spaceShip/explosion/exp-5.png deleted file mode 100644 index 1ea1753c..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-5.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-6.png b/sample/pascal-master/spaceShip/explosion/exp-6.png deleted file mode 100644 index 46133139..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-6.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-7.png b/sample/pascal-master/spaceShip/explosion/exp-7.png deleted file mode 100644 index 1ddc7a3b..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-7.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-8.png b/sample/pascal-master/spaceShip/explosion/exp-8.png deleted file mode 100644 index 7116420b..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-8.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/exp-9.png b/sample/pascal-master/spaceShip/explosion/exp-9.png deleted file mode 100644 index fb0162d1..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/exp-9.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion/explosion.gif-c200 b/sample/pascal-master/spaceShip/explosion/explosion.gif-c200 deleted file mode 100644 index eadc419b..00000000 Binary files a/sample/pascal-master/spaceShip/explosion/explosion.gif-c200 and /dev/null differ diff --git a/sample/pascal-master/spaceShip/explosion_4_39_128_corrected.png b/sample/pascal-master/spaceShip/explosion_4_39_128_corrected.png deleted file mode 100644 index 3038f007..00000000 Binary files a/sample/pascal-master/spaceShip/explosion_4_39_128_corrected.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/galaxy.jpg b/sample/pascal-master/spaceShip/galaxy.jpg deleted file mode 100644 index e0252868..00000000 Binary files a/sample/pascal-master/spaceShip/galaxy.jpg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/gameover.png b/sample/pascal-master/spaceShip/gameover.png deleted file mode 100644 index 3f097489..00000000 Binary files a/sample/pascal-master/spaceShip/gameover.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/geany_run_script.sh b/sample/pascal-master/spaceShip/geany_run_script.sh deleted file mode 100644 index 4a621a90..00000000 --- a/sample/pascal-master/spaceShip/geany_run_script.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -rm $0 - -"./spaceShip" - -echo " - ------------------- -(program exited with code: $?)" - - -echo "Press return to continue" -#to be more compatible with shells like dash -dummy_var="" -read dummy_var diff --git a/sample/pascal-master/spaceShip/music.ogg b/sample/pascal-master/spaceShip/music.ogg deleted file mode 100644 index bb32f132..00000000 Binary files a/sample/pascal-master/spaceShip/music.ogg and /dev/null differ diff --git a/sample/pascal-master/spaceShip/readme.txt b/sample/pascal-master/spaceShip/readme.txt deleted file mode 100644 index 75d1ca78..00000000 --- a/sample/pascal-master/spaceShip/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Red fighter image from http://3.bp.blogspot.com/-jGC08Dy0zg8/U405cNq1-MI/AAAAAAAABqU/38d5rmV1S8Y/s1600/redfighter0006.png diff --git a/sample/pascal-master/spaceShip/redfighter.png b/sample/pascal-master/spaceShip/redfighter.png deleted file mode 100644 index 56964548..00000000 Binary files a/sample/pascal-master/spaceShip/redfighter.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/redfighter1.png b/sample/pascal-master/spaceShip/redfighter1.png deleted file mode 100644 index da729834..00000000 Binary files a/sample/pascal-master/spaceShip/redfighter1.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rocket.png b/sample/pascal-master/spaceShip/rocket.png deleted file mode 100644 index 97fb14f3..00000000 Binary files a/sample/pascal-master/spaceShip/rocket.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-0.png b/sample/pascal-master/spaceShip/rotStar/a-0.png deleted file mode 100644 index 859bd56d..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-0.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-1.png b/sample/pascal-master/spaceShip/rotStar/a-1.png deleted file mode 100644 index 260e3cdd..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-1.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-10.png b/sample/pascal-master/spaceShip/rotStar/a-10.png deleted file mode 100644 index 737fa087..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-10.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-11.png b/sample/pascal-master/spaceShip/rotStar/a-11.png deleted file mode 100644 index 11720704..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-11.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-12.png b/sample/pascal-master/spaceShip/rotStar/a-12.png deleted file mode 100644 index c64f6731..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-12.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-13.png b/sample/pascal-master/spaceShip/rotStar/a-13.png deleted file mode 100644 index b746bf26..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-13.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-14.png b/sample/pascal-master/spaceShip/rotStar/a-14.png deleted file mode 100644 index e031bf38..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-14.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-15.png b/sample/pascal-master/spaceShip/rotStar/a-15.png deleted file mode 100644 index a34cbfd9..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-15.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-2.png b/sample/pascal-master/spaceShip/rotStar/a-2.png deleted file mode 100644 index 1ee1c295..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-2.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-3.png b/sample/pascal-master/spaceShip/rotStar/a-3.png deleted file mode 100644 index 49b2e55d..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-3.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-4.png b/sample/pascal-master/spaceShip/rotStar/a-4.png deleted file mode 100644 index a146da2e..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-4.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-5.png b/sample/pascal-master/spaceShip/rotStar/a-5.png deleted file mode 100644 index 23a50b90..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-5.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-6.png b/sample/pascal-master/spaceShip/rotStar/a-6.png deleted file mode 100644 index d74a5158..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-6.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-7.png b/sample/pascal-master/spaceShip/rotStar/a-7.png deleted file mode 100644 index c6b2d0a9..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-7.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-8.png b/sample/pascal-master/spaceShip/rotStar/a-8.png deleted file mode 100644 index d4174d24..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-8.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotStar/a-9.png b/sample/pascal-master/spaceShip/rotStar/a-9.png deleted file mode 100644 index 39d9b4c2..00000000 Binary files a/sample/pascal-master/spaceShip/rotStar/a-9.png and /dev/null differ diff --git a/sample/pascal-master/spaceShip/rotating-star-3d.gif b/sample/pascal-master/spaceShip/rotating-star-3d.gif deleted file mode 100644 index 013c1310..00000000 Binary files a/sample/pascal-master/spaceShip/rotating-star-3d.gif and /dev/null differ diff --git a/sample/pascal-master/spaceShip/spaceShip b/sample/pascal-master/spaceShip/spaceShip deleted file mode 100644 index 56eacbf3..00000000 Binary files a/sample/pascal-master/spaceShip/spaceShip and /dev/null differ diff --git a/sample/pascal-master/spaceShip/spaceShip.pas b/sample/pascal-master/spaceShip/spaceShip.pas deleted file mode 100644 index 09d3232c..00000000 --- a/sample/pascal-master/spaceShip/spaceShip.pas +++ /dev/null @@ -1,476 +0,0 @@ -program theSpaceShip; - -{ - Coded by Mohamed Aziz Knani, - medazizknani@gmail.com - mohamedazizknani.wordpress.com - Art is not made by me i just - borrowed it from the World Wide Web - Code is not commented but it's written well - and it's indented - Notice : you can use this code in your projects - or develop this game but you must notice the real - author :v - 2015 -} - -uses Allegro5, Al5image, - Al5acodec, Al5audio, - Sysutils, Al5font, - Al5ttf, Math, - Al5primitives; - - -Const - FPS = 60; - frame_delay = 10; - screen_h = 800; - screen_w = 600; -type - projectiles = (Bullet, Rocket); - bu = array [1..10] of record - ID : projectiles; - live : Boolean; - x, y : real; - rad, speed : real; - Img : ALLEGRO_BITMAPptr; - - end; - Ship = record - s, x, y, rad : real; - deg, Health : integer; - live : boolean; - end; - - asteroids = array of record - Image : ALLEGRO_BITMAPptr; - x, y : real; - rad : real; - live : boolean; - speed : real; - _size : byte; - end; - spriteZ = record - curr_frame, frame_count, - frame_delay, max_frames, - frame_height, frame_width : byte; - _size : integer; - images : array of ALLEGRO_BITMAPptr; - live : Boolean; - x, y : real; - end; - - evil = array [1..5] of record - x, y, rad : real; - deg : integer; - live : boolean; - health : integer; - end; - -Var - Display : ALLEGRO_DISPLAYptr; - redfighter, - SpaceWall : ALLEGRO_BITMAPptr; - cond : boolean; - timer : ALLEGRO_TIMERptr; - event_queue : ALLEGRO_EVENT_QUEUEptr; - ev : ALLEGRO_EVENT; - i : byte; - Up, Down, - redraw, Turbo : Boolean; - Bullets : bu; - TShip : Ship; - Mis : boolean; - song, - bulletSound : ALLEGRO_SAMPLEptr; - songInstance : ALLEGRO_SAMPLE_INSTANCEptr; - Tasteroids : asteroids; - asterNum : byte; - rotatingStar : spriteZ; - score : LongInt; - Tevil : evil; - Tevimg : ALLEGRO_BITMAPptr; - maxAst : byte; - Font1 : ALLEGRO_FONTptr; - gameOver : ALLEGRO_BITMAPptr; - Explosions : array [1..10] of spriteZ; - -procedure Initprojectiles(var Bullets : bu); forward; - -procedure InitAst(var Tasteroids : asteroids; Start, maxAst : byte); forward; - -procedure spawnStar(var rotatingStar : spriteZ); forward; - - -procedure alInit; -begin - al_init(); - al_init_image_addon(); - al_init_primitives_addon(); - al_init_acodec_addon(); - al_install_audio(); - al_install_keyboard(); - al_init_font_addon(); - al_init_ttf_addon(); - bulletSound := al_load_sample('bullet.ogg'); - al_reserve_samples(2); - - Font1 := al_load_font('alterebro-pixel-font.ttf', 72, 0); - Display := al_create_display(screen_h, screen_w); - timer := al_create_timer(1.0/FPS); - event_queue := al_create_event_queue(); - gameOver := al_load_bitmap('gameover.png'); - al_register_event_source(event_queue, al_get_display_event_source(Display)); - al_register_event_source(event_queue, al_get_timer_event_source(timer)); - al_register_event_source(event_queue, al_get_keyboard_event_source()); - - song := al_load_sample('music.ogg'); - songInstance := al_create_sample_instance(song); - al_set_sample_instance_playmode(songInstance, ALLEGRO_PLAYMODE_LOOP); - al_attach_sample_instance_to_mixer(songInstance, al_get_default_mixer()); - al_play_sample_instance(songInstance); -end; - -procedure Init; -var - i, j : byte; -begin - randomize; - TShip.s := 1; - TShip.x := 200; - TShip.y := 100; - TShip.x := 100; - - Mis := False; - - cond := True; - score := 0; - TShip.Health := 10; - maxAst := 5; - Setlength(Tasteroids, 5); - - Initprojectiles(Bullets); - InitAst(Tasteroids, 0, maxAst); - - - redfighter := al_load_bitmap('redfighter.png'); - SpaceWall := al_load_bitmap('galaxy.jpg'); - - { init the rotatingstar } - setLength(rotatingStar.images, 16); - rotatingStar.frame_delay := 2; - rotatingStar.max_frames := 16; - rotatingStar.live := False; - - for i:= 0 to rotatingStar.max_frames-1 do - rotatingStar.images[i] := al_load_bitmap('rotStar/a-'+InttoStr(i)+'.png'); - - rotatingStar.live := True; - rotatingStar._size := 72; - - for j:=1 to 10 do begin - Setlength(Explosions[j].images, 16); - Explosions[j].frame_delay := 1; - Explosions[j].max_frames := 16; - Explosions[j].live := False; - Explosions[j].frame_height := 200; - Explosions[j].frame_width := 200; - for i:=0 to Explosions[j].max_frames-1 do - Explosions[j].images[i] := al_load_bitmap('explosion/exp-'+IntToStr(i)+'.png'); - end; - spawnStar(rotatingStar); - -end; - -procedure Initprojectiles(var Bullets : bu); -Var - i : byte; -begin - - for i:=1 to 10 do begin - Bullets[i].ID := Bullet; - Bullets[i].Img := al_load_bitmap('bullet1.png'); - Bullets[i].live := False; - Bullets[i].speed := 10; - end; -end; - -procedure Fireprojectile(var Bullets : bu; TShip : Ship); -var - i : byte; -begin - for i:=1 to 10 do - if not(Bullets[i].live) then begin - Bullets[i].rad := TShip.rad + (random(3) * 0.1) ; - Bullets[i].live := True; - Bullets[i].x := TShip.x; - Bullets[i].y := TShip.y; - break; - end; -end; - -procedure Updateprojectile(var Bullets : bu) ; -var - i : byte; -begin - for i:=1 to 10 do - if Bullets[i].live then begin - Bullets[i].x += trunc(cos(Bullets[i].rad)*Bullets[i].speed); - Bullets[i].y += trunc(sin(Bullets[i].rad)*Bullets[i].speed); - if ((screen_h+16 < Bullets[i].x) or (-16 > Bullets[i].y)) - or ((screen_w+16 < Bullets[i].y) or (-16 > Bullets[i].x)) then begin - Bullets[i].live := False; - continue; - end; - al_draw_rotated_bitmap(Bullets[i].Img, 16 / 2, 16 / 2, Bullets[i].x, Bullets[i].y, Bullets[i].rad, 0); - - end; -end; - -procedure InitAst(var Tasteroids : asteroids; Start, maxAst : byte); -var - i, r : byte; -begin - for i:=Start to maxAst-1 do begin - Tasteroids[i].x := 0; - Tasteroids[i].y := 0; - Tasteroids[i].live := False; - r := random(3)+1; - Tasteroids[i].Image := al_load_bitmap('asteroid/asteroid'+ InttoStr(r) +'.png'); - al_convert_mask_to_alpha(Tasteroids[i].Image, al_map_rgb(255, 255, 255)) ; - Tasteroids[i].speed := r*1.5; - case r of - 1 : Tasteroids[i]._size := 32; - 2 : Tasteroids[i]._size := 40; - 3 : Tasteroids[i]._size := 44; - end; - end; -end; - -procedure spawnAst(var Tasteroids : asteroids; maxAst : byte); -var - i : byte; -begin - for i:=0 to maxAst-1 do - if not(Tasteroids[i].live) then begin - Tasteroids[i].live := True; - Tasteroids[i].rad := random(361) * pi / 180; - Tasteroids[i].x := random(801); - Tasteroids[i].y := -44; - break; - end; -end; - -procedure UpdateAst(var Tasteroids : asteroids; maxAst : byte) ; -var - i : byte; -begin - for i:=0 to maxAst-1 do - if Tasteroids[i].live then begin - Tasteroids[i].x += trunc(cos(Tasteroids[i].rad)*Tasteroids[i].speed); - Tasteroids[i].y += trunc(sin(Tasteroids[i].rad)*Tasteroids[i].speed); - if ((screen_h+44 < Tasteroids[i].x) or (-44 > Tasteroids[i].y)) - or ((screen_w+44 < Tasteroids[i].y) or (-44 > Tasteroids[i].x)) then begin - Tasteroids[i].live := False; - continue; - end; - al_draw_rotated_bitmap(Tasteroids[i].Image, Tasteroids[i]._size / 2, Tasteroids[i]._size / 2, - Tasteroids[i].x, Tasteroids[i].y, Tasteroids[i].rad, 0); - - end; -end; - -procedure collision(var Tasteroids : asteroids; var Bullets : bu; maxAst : byte); -var - i, j : byte; -begin - for i:=1 to 10 do - for j:=0 to maxAst-1 do - if (Tasteroids[j].live) then - if((Bullets[i].x > (Tasteroids[j].x - Tasteroids[i]._size)) - and (Bullets[i].x < (Tasteroids[j].x + Tasteroids[j]._size)) - and ((Bullets[i].y > (Tasteroids[j].y - Tasteroids[j]._size)) - and (Bullets[i].y < (Tasteroids[j].y + Tasteroids[j]._size)))) then begin - Bullets[i].live := False; - Tasteroids[j].live := False; - end; -end; - -procedure spriteMover(var curr_frame, frame_count : byte; frame_delay, max_frames : byte); -begin - - if (frame_count >= frame_delay ) then begin - curr_frame := curr_frame +1; - if (curr_frame >= max_frames) then curr_frame := 0; - frame_count := 0; - end; - frame_count := frame_count +1; -end; - - -procedure spawnStar(var rotatingStar : spriteZ); -begin - rotatingStar.live := True; - rotatingStar.x := random(601)+100; - rotatingStar.y := random(401)+100; -end; - -procedure starCollision(var rotatingStar : spriteZ; TShip : Ship); -begin - if((TShip.x > (rotatingStar.x - rotatingStar._size)) - and (TShip.x < (rotatingStar.x + rotatingStar._size)) - and ((TShip.y > (rotatingStar.y - rotatingStar._size)) - and (TShip.y < (rotatingStar.y + rotatingStar._size)))) then - rotatingStar.live := False; -end; - -procedure shipCollision(var TShip : Ship; var Tasteroids : asteroids; maxAst : byte); -var - j, i, k : byte; -begin - for j:= 0 to maxAst-1 do - if((TShip.x > (Tasteroids[j].x - Tasteroids[j]._size)) - and (TShip.x < (Tasteroids[j].x + Tasteroids[j]._size)) - and ((TShip.y > (Tasteroids[j].y - Tasteroids[j]._size)) - and (TShip.y < (Tasteroids[j].y + Tasteroids[j]._size)))) then begin - TShip.Health -= 1; - Tasteroids[j].live := False; - for i:=1 to 10 do - if not(Explosions[i].live ) then - with Explosions[i] do begin - x := TShip.x - Explosions[i].frame_width / 2; - y := TShip.y- Explosions[i].frame_height / 2; - live := True; - {break;} - end; - end; -end; - -procedure drawHealth(TShip : Ship); -begin - al_draw_filled_rectangle(420, 570, 760, 595 ,al_map_rgb(0, 0, 0)); - al_draw_filled_rectangle(440, 572.5, 440+(TShip.Health*30), 592.5, al_map_rgb(232, 44, 12)); -end; -{ -procedure updateEvil(var Tevil : Evil); -begin - -end; -} -procedure destruct; -var - i : byte; -begin - - for i:=0 to rotatingStar.max_frames-1 do - al_destroy_bitmap(rotatingStar.images[i]); - - al_destroy_bitmap(Tevimg); - al_destroy_bitmap(SpaceWall); - al_destroy_sample(bulletSound); - al_destroy_sample(song); - al_destroy_sample_instance(songInstance); - al_destroy_bitmap(redfighter); - al_destroy_event_queue(event_queue); - al_destroy_timer(timer); - al_destroy_display(Display); -end; - -BEGIN - alInit; - Init; - al_start_timer(timer); - while cond do begin - al_wait_for_event(event_queue, ev); - - if (ev._type = ALLEGRO_EVENT_DISPLAY_CLOSE) then cond := False - else if (ev._type = ALLEGRO_EVENT_KEY_DOWN) then - case ev.keyboard.keycode of - AlLEGRO_KEY_UP : Up := True; - ALLEGRO_KEY_DOWN : Down := True; - ALLEGRO_KEY_SPACE : Turbo := True; - ALLEGRO_KEY_W : begin - if Mis = False then - al_play_sample(bulletSound, 1, 0, 1, ALLEGRO_PLAYMODE_ONCE, nil); - Mis := True; - end; - ALLEGRO_KEY_N : if TShip.Health <= 0 then Init; - end - else if (ev._type = ALLEGRO_EVENT_KEY_UP) then - case ev.keyboard.keycode of - AlLEGRO_KEY_UP : Up := False; - ALLEGRO_KEY_DOWN : Down := False; - ALLEGRO_KEY_SPACE : Turbo := False; - ALLEGRO_KEY_W : Mis := False; - end - else if (ev._type = ALLEGRO_EVENT_TIMER) then begin - spawnAst(Tasteroids, maxAst); - if (Turbo) and (TShip.s <= 7) then TShip.s += 0.1 - else if TShip.s > 0 then TShip.s -= 0.1; - if Up then TShip.deg -= 3 - else if Down then TShip.deg += 3; - if Mis then Fireprojectile(Bullets, TShip); - TShip.rad := TShip.deg * pi /180; - TShip.x += trunc(cos(TShip.rad)*TShip.s); - TShip.y += trunc(sin(TShip.rad)*TShip.s); - {object redirection} - if (screen_h+68 < TShip.x) then TShip.x := -68 - else if (-76 > TShip.y) then TShip.y := screen_w+76 - else if (screen_w+76 < TShip.y) then TShip.y := -76 - else if (-68 > TShip.x) then TShip.x := screen_h+68; - redraw := True; - if redraw and al_is_event_queue_empty(event_queue) then begin - al_draw_bitmap(SpaceWall, 0, 0, 0); - {al_clear_to_color(al_map_rgb(0, 12, 11));} - { Drawing the ship :3 } - collision(Tasteroids, Bullets, maxAst); - Updateprojectile(Bullets); - with rotatingStar do begin - spriteMover(curr_frame, frame_count, frame_delay, max_frames); - al_draw_bitmap(images[curr_frame], x, y, 0); - starCollision(rotatingStar, TShip); - if not(live) then begin - { add score } - maxAst += 1; - Setlength(Tasteroids, maxAst); - InitAst(Tasteroids, maxAst-1, maxAst); - score += 10; - score += score div 10; - spawnStar(rotatingStar); - end; - end; - shipCollision(TShip, Tasteroids, maxAst); - for i:=1 to 10 do begin - if (Explosions[i].live) then begin - with Explosions[i] do begin - spriteMover(curr_frame, frame_count, frame_delay, max_frames); - al_draw_bitmap(images[curr_frame], x, y, 0); - if (curr_frame=max_frames-1) then begin - curr_frame := 0; - frame_count := 0; - live := False; - end; - end; - end; - end; - al_draw_rotated_bitmap(redfighter, 68 / 2, 76 / 2, TShip.x , TShip.y, TShip.rad , 0); - UpdateAst(Tasteroids, maxAst); - { Draw score } - al_draw_text(Font1, al_map_rgb(232, 44, 12), 20, 550, ALLEGRO_ALIGN_LEFT, IntToStr(score)); - { Draw Health bar } - drawHealth(TShip); - if TShip.Health <= 0 then begin - al_draw_bitmap(gameOver, 0, 0, 0); - end; - al_flip_display(); - redraw := False; - end; - end; - - end; - - destruct; -END. - - -{EOC (End Of Code yes I try always to be funny :v)} diff --git a/sample/pascal-master/test_dynamic_arrays b/sample/pascal-master/test_dynamic_arrays deleted file mode 100644 index cb3f029b..00000000 Binary files a/sample/pascal-master/test_dynamic_arrays and /dev/null differ diff --git a/sample/pascal-master/test_dynamic_arrays.pas b/sample/pascal-master/test_dynamic_arrays.pas deleted file mode 100644 index e69de29b..00000000 diff --git a/sample/pascal-master/theGame b/sample/pascal-master/theGame deleted file mode 100644 index d4b31f76..00000000 Binary files a/sample/pascal-master/theGame and /dev/null differ diff --git a/sample/pascal-master/theGame.pas b/sample/pascal-master/theGame.pas deleted file mode 100644 index f1911d34..00000000 --- a/sample/pascal-master/theGame.pas +++ /dev/null @@ -1,191 +0,0 @@ -(* Simple jeu réalise par Mohamed Aziz Knani - * Email : medazizknani@gmail.com - * Blog : http://mohamedazizknani.wordpress.com - * Sorry for the spaghetti code :v - *) - -program theGame; -uses ncurses,strings; -{$H+} -type - Ship = record - posx : integer; - shape : string; - ammunition : integer; - ammupos : array [1..100] of byte; { contient la postion des missiles } - end; - - Enemy = record - shape : char; - nbr : integer; - enepos : array[1..100] of byte; {contient la postion des ennemies} - end; - -var - max_y, max_x : integer; { les resolutions de la fenetre } - BShip : Ship; - BEnemy : Enemy; - rk : integer; - SlowE, i, k, new_x, new_y : integer; { des compteurs pour ralentir } - dashboard, field : Pwindow; - Score : integer; - -function newPos(Posi : char) : integer; -begin - if (Posi = 'L') and (3+BShip.posx <= max_x) then - newPos := 1+BShip.posx - else if (Posi = 'R') and (BShip.posx-2 >= 0) then - newPos := BShip.posx-1 - else newPos := BShip.posx; -end; - -procedure collision(var BShip : Ship; var BEnemy: Enemy; var score : integer); -var - j : integer; -begin - for j:=1 to max_x do - if (BShip.ammupos[j] = BEnemy.enepos[j]) and (BEnemy.enepos[j] <> 0) then begin - BShip.ammupos[j] := 0; - BEnemy.enepos[j] := 0; - Inc(Score); - end; -end; - -procedure Enemys(var BEnemy : Enemy); -var - j : byte; -begin - {Affichage} - for j:=1 to max_x do begin - {un hack pour ralentir l'ennemi} - if (SlowE mod 100 =0) and (BEnemy.enepos[j] in [2..max_y-5]) then begin - Inc(BEnemy.enepos[j]); - mvprintw(BEnemy.enepos[j], j, 'X'); - refresh; - SlowE := 0; - napms(15); - end - else if (BEnemy.enepos[j] > max_y) then BEnemy.enepos[j] := 0; - end; -end; - -procedure init(var BShip : Ship; var BEnemy : Enemy); -var - i : integer; -begin - BShip.ammunition := 200; - {Initialisation des position des missiles par la derniere ligne (max_y)} - {for i:=1 to 50 do - BEnemy.enepos[i] := -1;} - BShip.posx := max_x div 2; - BShip.shape := 'O'; - BEnemy.nbr := 15000; -end; - -procedure Shoot(var BShip : Ship); -var - j : byte; -begin - for j:=1 to max_x do - { un hack pour ralentir l'ennemi } - if (BShip.ammupos[j] in [1..max_y-5]) then begin - Dec(BShip.ammupos[j]); - mvprintw(BShip.ammupos[j], j, '|'); - refresh(); - {ralentir la missile pour un intervalle de 5 ms pour chaque une } - napms(5); - end; -end; - -Function IntToStr (I : Longint) : String; -var - s : String; -begin - Str(I,S); - IntToStr:=s; -end; - -procedure drawBox(win :PWINDOW); -var - x, y, i : integer; -begin - getmaxyx(win, y, x); - mvwprintw(win, 0, 0, '+'); - mvwprintw(win, y - 1, 0, '+'); - mvwprintw(win, 0, x - 1, '+'); - mvwprintw(win, y - 1, x - 1, '+'); - for i := 1 to (y - 2) do begin - mvwprintw(win, i, 0, '|'); - mvwprintw(win, i, x - 1, '|'); - end; - for i := 1 to (x - 2) do begin - mvwprintw(win, 0, i, '-'); - mvwprintw(win, y - 1, i, '-'); - end; -end; - -BEGIN - initscr(); - noecho(); - curs_set(0); - {cbreak(); } - getmaxyx(stdscr, max_y, max_x); {stdscr est la fenetre par default} - { des petits problemes sous les terminal linux (XFCE et Gnome) - un decalage d'un pixel (ou c'est juste moi) a essayer sous windows} - {Dec(max_y); Dec(max_x);} - init(BShip, BEnemy); - i := 0; k:=0; - { la procedure permet de ne pas attendre l'utilisateur d'entrer une touche - par contre elle retourne ERR si il n'entre rien} - field := newwin(max_y-3, max_x, 0, 0); - dashboard := newwin(3, max_x, max_y - 3, 0); - mvwprintw(field, 0, 0, 'Field'); - mvwprintw(dashboard, 0, 0, 'Score'); - drawBox(field); - drawBox(dashboard); - refresh(); - nodelay(stdscr, true); - nodelay(field, true); - while True do begin - Inc(i); Inc(k); - Inc(SlowE); - rk := getch(); - case rk of - 67 : BShip.posx :=newPos('L'); - 68 : BShip.posx :=newPos('R'); - 32 : begin - with BShip do - if ammunition > 0 then begin - ammupos[posx] := max_y-5; - Dec(ammunition); - end; - Shoot(BShip); - end; - end; - { nettoyage la fenetre field } - //wclear(field); - //wclear(dashboard); - drawBox(field); - drawBox(dashboard); - //mvwprintw(field, 1, 1, 'Field'); - // refresh each window - mvprintw(max_y-5, BShip.posx, 'O'); - refresh; - if (BEnemy.nbr > 0) and (k = 100) then begin - randomize; - BEnemy.enepos[random(max_x)+1] := 2; - Dec(BEnemy.nbr); - k := 0; - end; - Shoot(BShip); - Enemys(BEnemy); - collision(BShip, BEnemy, Score); - mvwprintw(dashboard, 1, 1, PChar(concat('Score : ', IntToStr(Score)))); - mvwprintw(dashboard, 1, max_x div 2 , PChar(concat('| Ammo : ', IntToStr(BShip.ammunition)))); - wrefresh(field); - wrefresh(dashboard); - {un petit dodo pour 3 millisecondes} - //napms(5); - end; - endwin(); -END. diff --git a/sample/pascal-master/tictactoe.pas b/sample/pascal-master/tictactoe.pas deleted file mode 100644 index cff8032d..00000000 --- a/sample/pascal-master/tictactoe.pas +++ /dev/null @@ -1,311 +0,0 @@ -program tictactoe; -{ - Simple jeu realisee par mohamed Aziz knani -} -uses wincrt, winprocs; - -type - tab = array [1..9] of string; - -var - countPartie, scoreJoueur1, scoreJoueur2 : integer; - nomJoueur1, nomJoueur2 : string; - symJoueur1, symJoueur2, rep : char; - bool : boolean; - t : tab; - choix : byte; - -(* procedure delay pour faire un sleep - * source -> http://www.developpez.net/forums/d1252400/autres-langages/pascal/turbo-pascal/procedure-delay-gettickcount/ -*) -procedure Delay(Millisecond:Integer); -var - fin:LongInt; -begin - fin:=GetTickCount+(Millisecond); - - repeat - until GetTickCount>=fin; -end; - -procedure joueur(var nom : string; var sym, symJoueur1 : char; nbJoueur : byte) ; -begin - write('Entrer le nom du joueur ', nbJoueur, ' -> '); - readln(nom); - if nbJoueur = 1 then - repeat - write('X ou O -> '); - readln(sym); - sym := upCase(sym); - until (sym = 'X') or (sym = 'O') - else - if symJoueur1 = 'O' then - sym := 'X' - else sym := 'O'; -end; - - -procedure jeu(t : tab; nomJoueur1, nomJoueur2 : string; symJoueur1, symJoueur2 : char; - var scoreJoueur1, scoreJoueur2 : integer; mode : byte); -var - tour : integer; - a, tourJoueur1, tourJoueur2 : boolean; - -function compare(valeur1, valeur2, valeur3 : string; var st : string) : boolean; -begin - compare := false; - (*writeln(valeur1, valeur2, valeur3); *) - - if ((valeur1 <> '') and (valeur2 <> '')) and (valeur3 <> '') then - if ((valeur1 = valeur2) and (valeur1 = valeur3)) and (valeur2 = valeur3) then - (* Moripon !!! *) - begin - compare := true; - st := valeur1; - end - else - compare := false; -end; - - -procedure affichage(t : tab; scoreJoueur1, scoreJoueur2 : integer); -var - i, x, y : byte; - -procedure inserer(x, y : byte; sym : char); -begin - gotoxy(y, x); - write(sym); - gotoxy(1, 11); -end; - -begin - clrscr; - write(' ', symJoueur1, ' % ', nomJoueur1, ' : ', scoreJoueur1, ' | ', - symJoueur2, ' % ', nomJoueur2, ' : ', scoreJoueur2); - writeln; - writeln; - writeln(' ---|---|---'); - writeln(' 1 | 2 | 3 '); - writeln(' ---|---|---'); - writeln(' 4 | 5 | 6 '); - writeln(' ---|---|---'); - writeln(' 7 | 8 | 9 '); - writeln(' ---|---|---'); - writeln; - for i:=1 to 9 do - begin - if t[i] <> '' then - begin - case i of - 1..3 : x := 4; - 4..6 : x := 6; - 7..9 : x := 8; - end; - case i of - 1, 4, 7 : y := 20; - 2, 5, 8 : y := 24; - 3, 6, 9 : y := 28; - end; - if t[i] = '1' then - inserer(x, y, symJoueur1) - else - inserer(x, y, symJoueur2) - end; - end; -end; - -procedure check(t : tab;var a: boolean;var scoreJoueur1, scoreJoueur2 : integer); -var - ega, st : string; - i : integer; -begin - if compare(t[1], t[2], t[3], st) or compare(t[4], t[5], t[6], st) or compare(t[7], t[8], t[9], st) - or compare(t[1], t[4], t[7], st) or compare(t[2], t[5], t[8], st) or compare(t[3], t[6], t[9], st) - or compare(t[1], t[5], t[9], st) or compare(t[3], t[5], t[7], st) then - begin - a := false; - if st = '1' then - begin - scoreJoueur1 := scoreJoueur1 + 1; - Writeln(nomJoueur1, ' vous avez gagner !'); - end - else - begin - scoreJoueur2 := scoreJoueur2 + 1; - Writeln(nomJoueur2, ' vous avez gagner !'); - end; - end; - ega := ''; - for i:=1 to 9 do - ega := ega + t[i]; - if (length(ega) = 9 ) and (st = '') then - begin - a := false; - writeln('Egalite !'); - end; -end; - -procedure saisieCase(var t : tab; nomJoueur : string; joueur : byte ); -var - choix : byte; - cho : boolean; - -function difficile(t : tab) : byte; -var - st : byte; - -function com(c1, c2, c3 : string; n1, n2, n3 : byte; var foo : byte) : boolean; -begin - if (c1 = c2) and (c3 = '') then - begin - foo := n3; - com := True; - end - else if (c1 = c3) and (c2 = '') then - begin - foo := n2; - com := True; - end - else if (c2 = c3) and (c1 = '') then - begin - foo := n1; - com := True; - end - else - com := False; -end; - -begin - if com(t[1], t[2], t[3], 1, 2, 3, st) or com(t[4], t[5], t[6], 4, 5, 6, st) or com(t[7], t[8], t[9], 7, 8, 9, st) - or com(t[1], t[4], t[7], 1, 4, 7, st) or com(t[2], t[5], t[8], 2, 5, 8, st) or com(t[3], t[6], t[9], 3, 6, 9, st) - or com(t[1], t[5], t[9], 1, 5, 9, st) or com(t[3], t[5], t[7], 3, 5, 7, st) then - begin - difficile := st; - writeln(st); - end - else - begin - randomize; - difficile := random(9) + 1; - end; -end; - -begin - repeat - cho := false; - if not(joueur in [2..3]) then - begin - write(nomJoueur, ' entrer un nombre entre [1, 9] -> ');readln(choix); - end - else - if joueur = 2 then - begin - randomize; - Delay(200); - choix := random(9) + 1; - end - else - if joueur = 3 then - begin - Delay(200); - choix := difficile(t); - end; - if t[choix] = '' then - begin - if joueur = 1 then - t[choix] := '1' - else t[choix] := '0'; - cho := true; - end; - until (choix in [1..9]) and cho; -end; - -begin - a := true; - randomize; - tour := random(2); - if tour = 1 then - begin - tourJoueur1 := true; - tourJoueur2 := false; - end - else - begin - tourJoueur1 := false; - tourJoueur2 := true; - end; - while a do - begin - affichage(t, scoreJoueur1, scoreJoueur2); - if tourJoueur1 then - begin - saisieCase(t, nomJoueur1, 1); - tourJoueur1 := false; - tourJoueur2 := true; - end; - affichage(t, scoreJoueur1, scoreJoueur2); - check(t, a, scoreJoueur1, scoreJoueur2); - if a then - begin - if tourJoueur2 then - begin - if mode = 1 then - mode := 0; - saisieCase(t, nomJoueur2, mode); - tourJoueur1 := true; - tourJoueur2 := false; - end; - affichage(t, scoreJoueur1, scoreJoueur2); - check(t, a, scoreJoueur1, scoreJoueur2); - end; - end; -end; - -BEGIN - repeat - clrscr; - writeln(' +---------------------------------------+'); - writeln(' | JEU de Tic Tac Toe |'); - writeln(' +---------------------------------------+'); - writeln; - writeln; - writeln(' 1) Joueur VS Joueur '); - writeln(' 2) Joueur VS Machine (niveau facile) '); - writeln(' 3) Joueur VS Machine (niveau difficile) '); - writeln; - writeln; - write (' Entrer un Choix > ');readln(choix); - until choix in [1..3]; - repeat - countPartie := countPartie + 1; - if countPartie = 1 then - if choix = 1 then - begin - joueur(nomJoueur1, symJoueur1, symJoueur1, 1); - joueur(nomJoueur2, symJoueur2, symJoueur1, 2); - end - else - begin - joueur(nomJoueur1, symJoueur1, symJoueur1, 1); - nomJoueur2 := 'Machine'; - if symJoueur1 = 'X' then - symJoueur2 := 'O' - else - symJoueur2 := 'X'; - end; - jeu(t, nomJoueur1, nomJoueur2, symJoueur1, symJoueur2, scoreJoueur1, scoreJoueur2, choix); - write('Une autre partie [Y/n] -> '); - read (rep); - rep := upCase(rep); - if rep = 'Y' then - bool := true - else bool := false; - until bool = false ; - clrScr; - if scoreJoueur1 > scoreJoueur2 then - writeln('Bien Joue ', nomJoueur1) - else - if scoreJoueur2 > scoreJoueur1 then - writeln('Bien Joue ', nomJoueur2); -END. \ No newline at end of file diff --git a/sample/pascal-master/tictactoe_freepascal b/sample/pascal-master/tictactoe_freepascal deleted file mode 100644 index d57e8a16..00000000 Binary files a/sample/pascal-master/tictactoe_freepascal and /dev/null differ diff --git a/sample/pascal-master/tictactoe_freepascal.pas b/sample/pascal-master/tictactoe_freepascal.pas deleted file mode 100644 index f494974f..00000000 --- a/sample/pascal-master/tictactoe_freepascal.pas +++ /dev/null @@ -1,344 +0,0 @@ -program tictactoe; -{ - Simple jeu realisee par mohamed Aziz knani - 2015 -} -uses crt; - -type - tab = array [1..9] of string; - -var - countPartie, scoreJoueur1, scoreJoueur2 : integer; - nomJoueur1, nomJoueur2 : string; - symJoueur1, symJoueur2, rep : char; - bool : boolean; - t : tab; - choix : byte; - -procedure joueur(var nom : string; var sym, symJoueur1 : char; nbJoueur : byte) ; -begin - write('Entrer le nom du joueur ', nbJoueur, ' -> '); - readln(nom); - if nbJoueur = 1 then - repeat - write('X ou O -> '); - readln(sym); - sym := upCase(sym); - until (sym = 'X') or (sym = 'O') - else - if symJoueur1 = 'O' then - sym := 'X' - else sym := 'O'; -end; - - -procedure jeu(t : tab; nomJoueur1, nomJoueur2 : string; symJoueur1, symJoueur2 : char; - var scoreJoueur1, scoreJoueur2 : integer; mode : byte); -var - tour : integer; - a, tourJoueur1, tourJoueur2 : boolean; - -function compare(valeur1, valeur2, valeur3 : string; var st : string) : boolean; -begin - compare := false; - (*writeln(valeur1, valeur2, valeur3); *) - - if ((valeur1 <> '') and (valeur2 <> '')) and (valeur3 <> '') then - if ((valeur1 = valeur2) and (valeur1 = valeur3)) and (valeur2 = valeur3) then - (* Moripon !!! *) - begin - compare := true; - st := valeur1; - end; -end; - - -procedure affichage(t : tab; scoreJoueur1, scoreJoueur2 : integer); -var - i, x, y : byte; - -procedure inserer(x, y : byte; sym : char; jr : byte); -begin - gotoxy(y, x); - if jr = 1 then - textcolor(Lightblue) - else textcolor(red); - write(sym); - textcolor(Lightgray); - gotoxy(1, 11); -end; - -begin - clrscr; - write(' ', symJoueur1, ' % ', nomJoueur1, ' : ', scoreJoueur1, ' | ', - symJoueur2, ' % ', nomJoueur2, ' : ', scoreJoueur2); - writeln; - writeln; - writeln(' ---|---|---'); - writeln(' 1 | 2 | 3 '); - writeln(' ---|---|---'); - writeln(' 4 | 5 | 6 '); - writeln(' ---|---|---'); - writeln(' 7 | 8 | 9 '); - writeln(' ---|---|---'); - writeln; - if tourJoueur1 then begin - textcolor(Lightblue); - Writeln('Le tour de ', nomJoueur1); - - end - else begin - textcolor(Red); - Writeln('Le tour de ', nomJoueur2 ); - end; - - textcolor(Lightgray); - for i:=1 to 9 do - begin - if t[i] <> '' then - begin - case i of - 1..3 : x := 4; - 4..6 : x := 6; - 7..9 : x := 8; - end; - case i of - 1, 4, 7 : y := 20; - 2, 5, 8 : y := 24; - 3, 6, 9 : y := 28; - end; - if t[i] = '1' then - inserer(x, y, symJoueur1, 1) - else - inserer(x, y, symJoueur2, 0) - end; - end; - Delay(100); -end; - -procedure check(t : tab;var a: boolean;var scoreJoueur1, scoreJoueur2 : integer); -var - ega, st : string; - i : integer; -begin - if compare(t[1], t[2], t[3], st) or compare(t[4], t[5], t[6], st) or compare(t[7], t[8], t[9], st) - or compare(t[1], t[4], t[7], st) or compare(t[2], t[5], t[8], st) or compare(t[3], t[6], t[9], st) - or compare(t[1], t[5], t[9], st) or compare(t[3], t[5], t[7], st) then - begin - a := false; - if st = '1' then - begin - scoreJoueur1 := scoreJoueur1 + 1; - Writeln(nomJoueur1, ' vous avez gagner !'); - end - else - begin - scoreJoueur2 := scoreJoueur2 + 1; - Writeln(nomJoueur2, ' vous avez gagner !'); - end; - end; - ega := ''; - for i:=1 to 9 do - ega := ega + t[i]; - if (length(ega) = 9 ) and (st = '') then - begin - a := false; - writeln('Egalite !'); - end; -end; - -procedure saisieCase(var t : tab; nomJoueur : string; joueur : byte ); -var - choix : byte; - cho : boolean; - -function difficile(t : tab) : byte; -var - st : byte; - -function com(c1, c2, c3 : string; n1, n2, n3 : byte; var foo : byte) : boolean; -begin - if (c1 = c2) and (c3 = '') then - begin - foo := n3; - com := True; - end - else if (c1 = c3) and (c2 = '') then - begin - foo := n2; - com := True; - end - else if (c2 = c3) and (c1 = '') then - begin - foo := n1; - com := True; - end - else - com := False; -end; - -begin - if t[5] = '' then begin - difficile := 5; - exit; - end; - if com(t[1], t[2], t[3], 1, 2, 3, st) or com(t[4], t[5], t[6], 4, 5, 6, st) or com(t[7], t[8], t[9], 7, 8, 9, st) - or com(t[1], t[4], t[7], 1, 4, 7, st) or com(t[2], t[5], t[8], 2, 5, 8, st) or com(t[3], t[6], t[9], 3, 6, 9, st) - or com(t[1], t[5], t[9], 1, 5, 9, st) or com(t[3], t[5], t[7], 3, 5, 7, st) then - begin - difficile := st; - writeln(st); - end - else - begin - randomize; - difficile := random(9) + 1; - end; -end; -var - k : Boolean; - Cursor_x, Cursor_y : Byte; - KeyClick : Char; -begin - repeat - cho := false; - if not(joueur in [2..3]) then - begin - Cursor_x := 20; - Cursor_y := 4; - k:= True; - gotoxy(Cursor_x, Cursor_y); - while k do begin - KeyClick := ReadKey(); - {If the user player clicks keyboard arrows} - case KeyClick of - #106: if (Cursor_y+2<=9) then Cursor_y += 2; - #107: if (Cursor_y-2>=4) then Cursor_y -= 2; - #104: if (Cursor_x-4>=20) then Cursor_x -= 4; - #108: if (Cursor_x+4<=28) then Cursor_x += 4; - - #32: begin - choix := ((Cursor_y div 2)-2) * 3 + ((Cursor_x div 4)-5) +1; - k := False; - end; - end; - gotoxy(Cursor_x, Cursor_y); - end; - end - else - {The computer choice (random choice)} - if joueur = 2 then - begin - randomize; - choix := random(9) + 1; - end - else - {The computer's "smart" choice} - if joueur = 3 then - begin - choix := difficile(t); - - end; - if t[choix] = '' then - begin - if joueur = 1 then - t[choix] := '1' - else t[choix] := '0'; - cho := true; - end; - until (choix in [1..9]) and cho; -end; - -begin - a := true; - randomize; - tour := random(2); - if tour = 1 then - begin - tourJoueur1 := true; - tourJoueur2 := false; - end - else - begin - tourJoueur1 := false; - tourJoueur2 := true; - end; - while a do - begin - affichage(t, scoreJoueur1, scoreJoueur2); - if tourJoueur1 then - begin - saisieCase(t, nomJoueur1, 1); - tourJoueur1 := false; - tourJoueur2 := true; - end; - affichage(t, scoreJoueur1, scoreJoueur2); - check(t, a, scoreJoueur1, scoreJoueur2); - if a then - begin - if tourJoueur2 then - begin - if mode = 1 then - mode := 0; - saisieCase(t, nomJoueur2, mode); - tourJoueur1 := true; - tourJoueur2 := false; - end; - affichage(t, scoreJoueur1, scoreJoueur2); - check(t, a, scoreJoueur1, scoreJoueur2); - end; - end; -end; - - - -BEGIN - repeat - clrscr; - textcolor(Lightblue); - writeln(' +---------------------------------------+'); - writeln(' | JEU de Tic Tac Toe |'); - writeln(' +---------------------------------------+'); - textcolor(Lightgray); - writeln; - writeln; - writeln(' 1) Joueur VS Joueur '); - writeln(' 2) Joueur VS Machine (niveau facile) '); - writeln(' 3) Joueur VS Machine (niveau difficile) '); - writeln; - writeln; - write (' Entrer un Choix > ');readln(choix); - until choix in [1..3]; - repeat - countPartie := countPartie + 1; - if countPartie = 1 then - if choix = 1 then - begin - joueur(nomJoueur1, symJoueur1, symJoueur1, 1); - joueur(nomJoueur2, symJoueur2, symJoueur1, 2); - end - else - begin - joueur(nomJoueur1, symJoueur1, symJoueur1, 1); - nomJoueur2 := 'Machine'; - if symJoueur1 = 'X' then - symJoueur2 := 'O' - else - symJoueur2 := 'X'; - end; - jeu(t, nomJoueur1, nomJoueur2, symJoueur1, symJoueur2, scoreJoueur1, scoreJoueur2, choix); - write('Une autre partie [Y/n] -> '); - read (rep); - rep := upCase(rep); - if rep = 'Y' then - bool := true - else bool := false; - until bool = false ; - clrScr; - if scoreJoueur1 > scoreJoueur2 then - writeln('Bien Joue ', nomJoueur1) - else - if scoreJoueur2 > scoreJoueur1 then - writeln('Bien Joue ', nomJoueur2); -END. diff --git a/sample/snake-game-in-turboPascal-master/LICENSE b/sample/snake-game-in-turboPascal-master/LICENSE deleted file mode 100644 index cf3b3371..00000000 --- a/sample/snake-game-in-turboPascal-master/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 AlexR1712 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/sample/snake-game-in-turboPascal-master/README.md b/sample/snake-game-in-turboPascal-master/README.md deleted file mode 100644 index e9536998..00000000 --- a/sample/snake-game-in-turboPascal-master/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# snake-game-in-turboPascal -> Juego de SNAKE realizado en Turbo Pascal, this is only functional experiment. diff --git a/sample/snake-game-in-turboPascal-master/culebra.pas b/sample/snake-game-in-turboPascal-master/culebra.pas deleted file mode 100644 index 9a5b71fc..00000000 --- a/sample/snake-game-in-turboPascal-master/culebra.pas +++ /dev/null @@ -1,266 +0,0 @@ -program snake; -uses crt; - -var - tamanoculebra : byte; - posculebra : array[1..50, 1..2] of byte; - poscomida : array[1..2] of byte; - puntos : integer; - hit, direction : char; - jugando : boolean; - -procedure crear_mapa; -var - row, col : byte; -begin - for row:=2 to 24 do - begin - if (row = 2) or (row = 24) then - begin - for col:=2 to 79 do - begin - textbackground(blue); - gotoxy(col, row); - write(' '); - end; - end else begin - textbackground(blue); - gotoxy(2, row); - write(' '); - gotoxy(79, row); - write(' '); - end; - end; -end; - -procedure puntos_es; -begin - gotoxy(1, 1); - textcolor(red); - textbackground(black); - write('Puntos: '); - textcolor(white); - write(puntos); -end; - -function velocidad : word; -var - speed : word; -begin - if puntos < 100 then - speed := 150 - else if puntos < 200 then - speed := 100 - else - speed := 50; - velocidad := speed; -end; - -procedure crea_culebra; -var - tculebra : byte; -begin - tamanoculebra := 6; - for tculebra:=1 to tamanoculebra do - begin - posculebra[tculebra][1] := 39 + tculebra; - posculebra[tculebra][2] := 12; - end; -end; - -procedure crea1_culebra; -var - tculebra : byte; -begin - for tculebra:=1 to tamanoculebra do - begin - if tculebra = 1 then - textbackground(green) - else - textbackground(lightgray); - gotoxy(posculebra[tculebra][1], posculebra[tculebra][2]); - write(' '); - end; -end; - -function en_arreglo(x, y : byte; first : boolean) : boolean; -var - helper : boolean; - tculebra : byte; -begin - if first then - tculebra := 1 - else - tculebra := 2; - helper := false; - while (tculebra <= tamanoculebra) and not helper do - begin - if (x = posculebra[tculebra][1]) and (y = posculebra[tculebra][2]) then - helper := true; - tculebra := tculebra + 1; - end; - en_arreglo := helper; -end; - -procedure comida; -begin - randomize; - repeat - poscomida[1] := random(76) + 3; - poscomida[2] := random(21) + 3; - until not en_arreglo(poscomida[1], poscomida[2], true); - textbackground(black); - textcolor(red); - gotoxy(poscomida[1], poscomida[2]); - write('*'); -end; - -procedure mov_culebra(dir : char); -var - tculebra : byte; - last : array[1..2] of byte; -begin - textbackground(black); - gotoxy(posculebra[tamanoculebra][1], posculebra[tamanoculebra][2]); - write(' '); - last[1] := posculebra[tamanoculebra][1]; - last[2] := posculebra[tamanoculebra][2]; - for tculebra:=tamanoculebra downto 2 do - begin - posculebra[tculebra][1] := posculebra[tculebra - 1][1]; - posculebra[tculebra][2] := posculebra[tculebra - 1][2]; - end; - case dir of - 'l' : posculebra[1][1] := posculebra[1][1] - 1; - 'r' : posculebra[1][1] := posculebra[1][1] + 1; - 'u' : posculebra[1][2] := posculebra[1][2] - 1; - 'd' : posculebra[1][2] := posculebra[1][2] + 1; - end; - - if (posculebra[1][1] = poscomida[1]) and (posculebra[1][2] = poscomida[2]) then - begin - puntos := puntos + 10; - puntos_es; - if tamanoculebra <= 50 then - begin - tamanoculebra := tamanoculebra + 1; - posculebra[tamanoculebra][1] := last[1]; - posculebra[tamanoculebra][2] := last[2]; - end; - comida; - end; - if (posculebra[1][1] = 2) or (posculebra[1][1] = 79) or (posculebra[1][2] = 2) or (posculebra[1][2] = 24) then - begin - jugando := false; - end; - if en_arreglo(posculebra[1][1], posculebra[1][2], false) then - begin - jugando := false; - end; -end; - -procedure juego; -begin - jugando := true; - textbackground(black); - clrscr; - crear_mapa; - puntos := 0; - puntos_es; - crea_culebra; - crea1_culebra; - comida; - - direction := 'l'; - repeat - if not jugando then - hit := #27 - else begin - if keypressed then - hit := readkey; - - if (hit = #75) and (direction <> 'r') then - direction := 'l' - else if (hit = #77) and (direction <> 'l') then - direction := 'r' - else if (hit = #72) and (direction <> 'd') then - direction := 'u' - else if (hit = #80) and (direction <> 'u') then - direction := 'd'; - - mov_culebra(direction); - crea1_culebra; - delay(velocidad); - end; - until hit = #27; - - if not jugando then - begin - textbackground(black); - clrscr; - gotoxy(35, 11); - textcolor(yellow); - write('Has Perdido!'); - gotoxy(15, 16); - textcolor(red); - write('ESC: '); - textcolor(white); - write('Salir'); - gotoxy(51, 16); - textcolor(red); - write('ESPACIO: '); - textcolor(white); - write('Continuar'); - repeat - hit := readkey; - if hit = #32 then - juego; - until (hit = #27) or (hit = #32); - end -end; - - -begin - port[$3D4] := $A; - port[$3D5] := 16; - - jugando := false; - clrscr; - - textcolor(red); - gotoxy(21, 7); - write(' _____ _ _ '); - gotoxy(21, 8); - write(' / ____| | | | | '); - gotoxy(21, 9); - write(' | | _ _| | ___| |__ _ __ __ _ '); - gotoxy(21, 10); - write(' | | | | | | |/ _ \ _ \| __/ _` |'); - gotoxy(21, 11); - write(' | |___| |_| | | __/ |_) | | | (_| |'); - gotoxy(21, 12); - write(' \_____\__,_|_|\___|_.__/|_| \__,_|'); - write(' '); - gotoxy(21, 13); - write('Realizado por Alexander Rodriguez |', '@AlexR1712'); - gotoxy(21, 14); - - - readkey; - juego; - - textbackground(black); - clrscr; - gotoxy(28, 7); - textcolor(white); - write('Un juego sencillo basado en el famoso juego de SNAKE y recreado con ayuda de tutoriales y Pastebin'); - gotoxy(35, 11); - textcolor(yellow); - write('La Culebrita 1.0 por Alexander Rodriguez'); - gotoxy(27, 14); - textcolor(green); - write('MegaHosting Venezuela '); - textcolor(red); - write('Salir'); - readkey; -end. diff --git a/sample/sphinx-astar-master/IA.pas b/sample/sphinx-astar-master/IA.pas deleted file mode 100644 index 4c15c378..00000000 --- a/sample/sphinx-astar-master/IA.pas +++ /dev/null @@ -1,320 +0,0 @@ -Unit IA; - -interface - uses listesChainees, joueur, astar, Crt; - - function case_arrivee(plateau : ArrayOfInteger) : Coordonnees; - function generer_plateau(hauteur, largeur, nombreDeMurs : Integer) : ArrayOfInteger; - function verif_cases_adjacentes(plateau : ArrayOfInteger; x, y : Integer; coordonneesCase : Coordonnees) : Boolean; - procedure tour_IA(var IAGagne : Boolean; var plateauJoueurIA : ArrayOfInteger; var caseActuelleIA, caseArriveeIA : Coordonnees); - -implementation - - { - Coordonnees case_arrivee(ArrayOfInteger plateau); - * Renvoie les coordonnées de la case trésor du plateau envoyé en paramètre. - } - function case_arrivee(plateau : ArrayOfInteger) : Coordonnees; - var i, j : Integer; caseArrivee : Coordonnees; - begin - for i := 0 to high(plateau) do - begin - for j := 0 to high(plateau[0]) do - begin - if( plateau[i, j] = 3) then - begin - caseArrivee.x := i; - caseArrivee.y := j; - exit(caseArrivee); - end; - end; - end; - end; - - { - function verif_cases_adjacentes(plateau, x, y : Integer; coordonneesCase : Coordonnees) : Boolean; - * Vérifie que les cases ajacentes à la case dont les coordonnées sont les deux premiers paramètres ne sont pas des cases vides ou l'entrée (sauf la case indiquée en 4ème paramètre) - } - - function verif_cases_adjacentes(plateau : ArrayOfInteger; x, y : Integer; coordonneesCase : Coordonnees) : Boolean; - begin - if( ((x - 1) < 0) OR (x - 1 = coordonneesCase.x) OR ((plateau[x - 1, y] <> 0) AND (plateau[x - 1, y] <> 2)) ) then//Haut - begin - if( ((x + 1) > high(plateau)) OR (x + 1 = coordonneesCase.x) OR ((plateau[x + 1, y] <> 0) AND (plateau[x + 1, y] <> 2)) ) then//Bas - begin - if( ((y - 1) < 0) OR (y - 1 = coordonneesCase.y) OR ((plateau[x, y - 1] <> 0) AND (plateau[x, y - 1] <> 2)) ) then//Gauche - begin - if( ((y + 1) > high(plateau[0])) OR (y + 1 = coordonneesCase.y) OR ((plateau[x, y + 1] <> 0) AND (plateau[x, y + 1] <> 2)) ) then//Droite - begin - verif_cases_adjacentes := TRUE; - end - else - verif_cases_adjacentes := FALSE; - end - else - verif_cases_adjacentes := FALSE; - end - else - verif_cases_adjacentes := FALSE; - end - else - verif_cases_adjacentes := FALSE; - end; - - { - function generer_plateau(hauteur, largeur, nombreDeMurs : Integer) : ArrayOfInteger; - * Génère un plateau à partir des paramètres renseignés - } - function generer_plateau(hauteur, largeur, nombreDeMurs : Integer) : ArrayOfInteger; - - var plateau : Array of Array of Integer; - i, j, nbDeMursRestant, direction : Integer; - listeCases, caseActuelle : PCellule; - - Const HAUT = 1; BAS = 2; GAUCHE = 3; DROITE = 4; - - begin - { - * Création et initialisation du plateau - } - setlength(plateau, hauteur, largeur); - - for i := 0 to high(plateau) do - begin - for j := 0 to high(plateau[i]) do plateau[i,j] := 1; - end; - - { - * Génération du labyrinthe - } - - //Initialisation de la liste des cases composant le chemin actuel - new(listeCases); - listeCases^.coordonneesCase.x := random(high(plateau) + 1); - listeCases^.coordonneesCase.y := random(high(plateau[0]) + 1); - listeCases^.contraintesCase.haut := FALSE; - listeCases^.contraintesCase.bas := FALSE; - listeCases^.contraintesCase.gauche := FALSE; - listeCases^.contraintesCase.droite := FALSE; - listeCases^.precedent := NIL; - listeCases^.suivant := NIL; - caseActuelle := listeCases; - - //On commence par choisir une case de départ au hasard - plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] := 2; - - nbDeMursRestant := hauteur * largeur - 1; - - while(nbDeMursRestant > nombreDeMurs) do - begin - if( NOT(caseActuelle^.contraintesCase.haut) OR NOT(caseActuelle^.contraintesCase.bas) OR NOT(caseActuelle^.contraintesCase.gauche) OR NOT(caseActuelle^.contraintesCase.droite) ) then - begin - //Génération de la direction - direction := random(4) + 1; - - { - On va maintenant vérifier que la direction est correcte, c'est-à-dire : - * qu'il n'existe pas déjà une contrainte qui interdise le déplacement - * que l'on ne rencontre pas une des limites du plateau - * que la case demandée ne soit pas déjà attribuée à la case départ - * que l'une des cases adjacentes à la case demandée n'est pas déjà rattachée au labyrinthe (sauf la case en cours bien entendu) - } - case direction of - HAUT : - begin - if( NOT(caseActuelle^.contraintesCase.haut) ) then - begin - if( caseActuelle^.coordonneesCase.x - 1 >= 0 ) then - begin - if( plateau[caseActuelle^.coordonneesCase.x - 1, caseActuelle^.coordonneesCase.y] <> 2 ) then - begin - if( verif_cases_adjacentes(plateau, caseActuelle^.coordonneesCase.x - 1, caseActuelle^.coordonneesCase.y, caseActuelle^.coordonneesCase) ) then - begin - //Toutes les conditions requises sont remplies, on ajoute donc la case à l'historique et on remplace le contenu de la case actuelle par un vide. - ajouter_item(listeCases, caseActuelle^.coordonneesCase.x - 1, caseActuelle^.coordonneesCase.y, caseActuelle); - if( plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] <> 0 ) then - begin - plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] := 0; - nbDeMursRestant := nbDeMursRestant - 1; - end; - end - else - caseActuelle^.contraintesCase.haut := TRUE;//Si l'une des cases adjacentes à la case demandée est déjà rattachée au labyrinthe (sauf la case en cours), on bloque cette direction pour le prochain tour de boucle. - end - else - caseActuelle^.contraintesCase.haut := TRUE;//Si la case demandée est déjà occuppée par l'entrée, on bloque la direction. - end - else - caseActuelle^.contraintesCase.haut := TRUE;//Si l'on voit que l'on a rencontré la limite haute du plateau, on bloque cette direction pour le prochain tour de boucle. - end; - end; - BAS : - begin - if( NOT(caseActuelle^.contraintesCase.bas) ) then - begin - if( caseActuelle^.coordonneesCase.x + 1 <= high(plateau) ) then - begin - if( plateau[caseActuelle^.coordonneesCase.x + 1, caseActuelle^.coordonneesCase.y] <> 2 ) then - begin - if( verif_cases_adjacentes(plateau, caseActuelle^.coordonneesCase.x + 1, caseActuelle^.coordonneesCase.y, caseActuelle^.coordonneesCase) ) then - begin - //Toutes les conditions requises sont remplies, on ajoute donc la case à l'historique et on remplace le contenu de la case actuelle par un vide. - ajouter_item(listeCases, caseActuelle^.coordonneesCase.x + 1, caseActuelle^.coordonneesCase.y, caseActuelle); - if( plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] <> 0 ) then - begin - plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] := 0; - nbDeMursRestant := nbDeMursRestant - 1; - end; - end - else - caseActuelle^.contraintesCase.bas := TRUE;//Si l'une des cases adjacentes à la case demandée est déjà rattachée au labyrinthe (sauf la case en cours), on bloque cette direction pour le prochain tour de boucle. - end - else - caseActuelle^.contraintesCase.bas := TRUE;//Si la case demandée est déjà occuppée par l'entrée, on bloque la direction. - end - else - caseActuelle^.contraintesCase.bas := TRUE;//Si l'on voit que l'on a rencontré la limite basse du plateau, on bloque cette direction pour le prochain tour de boucle. - end; - end; - GAUCHE : - begin - if( NOT(caseActuelle^.contraintesCase.gauche) ) then - begin - if( caseActuelle^.coordonneesCase.y - 1 >= 0 ) then - begin - if( plateau[caseActuelle^.coordonneesCase.x, caseActuelle^.coordonneesCase.y - 1] <> 2 ) then - begin - if( verif_cases_adjacentes(plateau, caseActuelle^.coordonneesCase.x, caseActuelle^.coordonneesCase.y - 1, caseActuelle^.coordonneesCase) ) then - begin - //Toutes les conditions requises sont remplies, on ajoute donc la case à l'historique et on remplace le contenu de la case actuelle par un vide. - ajouter_item(listeCases, caseActuelle^.coordonneesCase.x, caseActuelle^.coordonneesCase.y - 1, caseActuelle); - if( plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] <> 0 ) then - begin - plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] := 0; - nbDeMursRestant := nbDeMursRestant - 1; - end; - end - else - caseActuelle^.contraintesCase.gauche := TRUE;//Si l'une des cases adjacentes à la case demandée est déjà rattachée au labyrinthe (sauf la case en cours), on bloque cette direction pour le prochain tour de boucle. - end - else - caseActuelle^.contraintesCase.gauche := TRUE;//Si la case demandée est déjà occuppée par l'entrée, on bloque la direction. - end - else - caseActuelle^.contraintesCase.gauche := TRUE;//Si l'on voit que l'on a rencontré la limite gauche du plateau, on bloque cette direction pour le prochain tour de boucle. - end; - end; - DROITE : - begin - if( NOT(caseActuelle^.contraintesCase.droite) ) then - begin - if( caseActuelle^.coordonneesCase.y + 1 <= high(plateau[0]) ) then - begin - if( plateau[caseActuelle^.coordonneesCase.x, caseActuelle^.coordonneesCase.y + 1] <> 2 ) then - begin - if( verif_cases_adjacentes(plateau, caseActuelle^.coordonneesCase.x, caseActuelle^.coordonneesCase.y + 1, caseActuelle^.coordonneesCase) ) then - begin - //Toutes les conditions requises sont remplies, on ajoute donc la case à l'historique et on remplace le contenu de la case actuelle par un vide. - ajouter_item(listeCases, caseActuelle^.coordonneesCase.x, caseActuelle^.coordonneesCase.y + 1, caseActuelle); - if( plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] <> 0 ) then - begin - plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] := 0; - nbDeMursRestant := nbDeMursRestant - 1; - end; - end - else - caseActuelle^.contraintesCase.droite := TRUE;//Si l'une des cases adjacentes à la case demandée est déjà rattachée au labyrinthe (sauf la case en cours), on bloque cette direction pour le prochain tour de boucle. - end - else - caseActuelle^.contraintesCase.droite := TRUE;//Si la case demandée est déjà occuppée par l'entrée, on bloque la direction. - end - else - caseActuelle^.contraintesCase.droite := TRUE;//Si l'on voit que l'on a rencontré la limite basse du plateau, on bloque cette direction pour le prochain tour de boucle. - end; - end; - end; - end - else - begin - //Si toutes les contraintes sont activées, on recule d'une case. - remove_item_end(listeCases, caseActuelle); - - //Si le processus de génération est bloqué, on termine la procédure. - if( listeCases^.suivant = NIL ) then - begin - SetLength(plateau, 0); - exit(plateau); - end; - end; - end; - plateau[caseActuelle^.coordonneesCase.x,caseActuelle^.coordonneesCase.y] := 3;//On place le trésor - clear_list(listeCases); - generer_plateau := plateau; - end; - - { - procedure tour_IA(var IAGagne : Boolean; var plateauJoueurIA : ArrayOfInteger; var caseActuelleIA, caseArriveeIA : Coordonnees); - * Joue le coup de l'IA. - } - procedure tour_IA(var IAGagne : Boolean; var plateauJoueurIA : ArrayOfInteger; var caseActuelleIA, caseArriveeIA : Coordonnees); - var choix : Char; - itineraire : ArrayOfNode; - caseDemandee : Node; - caseSuivante : Integer; - begin - itineraire := find_path(plateauJoueurIA, caseActuelleIA, caseArriveeIA); - caseDemandee := itineraire[0]; - caseSuivante := 1; - - while( ( plateauJoueurIA[caseActuelleIA.x, caseActuelleIA.y] <> 3 ) ) do - begin - ClrScr; - afficher_plateau(plateauJoueurIA); - if( plateauJoueurIA[caseDemandee.x, caseDemandee.y] <> 4) then - begin - if( plateauJoueurIA[caseDemandee.x, caseDemandee.y] <> 2 ) then - begin - caseActuelleIA.x := caseDemandee.x; - caseActuelleIA.y := caseDemandee.y; - caseDemandee := itineraire[caseSuivante]; - inc(caseSuivante); - end; - end - else - begin - //Le contenu est inconnu, il faut donc le demander au joueur - writeln('Quel est le contenu de la case [', caseDemandee.x + 1, ',', caseDemandee.y + 1, '] ?'); - writeln('(v)ide'); - writeln('(m)ur'); - repeat - choix := readkey; - until((choix = 'm') OR (choix = 'v')); - case choix of - 'm' : - begin - plateauJoueurIA[caseDemandee.x, caseDemandee.y] := 1; - finalize(itineraire); - exit; - end; - 'v' : - begin - caseActuelleIA.x := caseDemandee.x; - caseActuelleIA.y := caseDemandee.y; - plateauJoueurIA[caseActuelleIA.x, caseActuelleIA.y] := 0; - caseDemandee := itineraire[caseSuivante]; - inc(caseSuivante); - end; - end; - end; - end; - if( plateauJoueurIA[caseActuelleIA.x, caseActuelleIA.y] = 3 ) then - begin - writeln('J''ai gagné !'); - finalize(itineraire); - IAGagne := TRUE; - end; - end; - -begin - {Corps du module IA} -end. diff --git a/sample/sphinx-astar-master/astar.pas b/sample/sphinx-astar-master/astar.pas deleted file mode 100644 index c27a7d5d..00000000 --- a/sample/sphinx-astar-master/astar.pas +++ /dev/null @@ -1,279 +0,0 @@ -Unit Astar; - -interface - uses Crt, listesChainees; - - function distance(x1, y1, x2, y2 : Integer) : Integer; - procedure remove_from_tab(lowestInd : Integer; var openList : ArrayOfNode); - procedure add_to_tab(toAdd : Node; var tab : ArrayOfNode); - procedure init_nodes(var nodesList : DoubleArrayOfNode); - procedure modif_tab(nodeToUp : Node; var tab : ArrayOfNode); - procedure remove_from_open_list(lowestInd : Integer; var openList : ArrayOfNode; var nodesList : DoubleArrayOfNode); - function find_path(plateau : ArrayOfInteger; caseFrom : Coordonnees; caseTo : Coordonnees) : ArrayOfNode; - function get_neighbors(nodesList : DoubleArrayOfNode; currentNode : Node) : ArrayOfNode; - -implementation - - { - int distance(int x1, int y1, int x2, int y2); - * Retourne la distance de Manhattan d'un point à un autre. - } - function distance(x1, y1, x2, y2 : Integer) : Integer; - begin - distance := abs(x2 - x1) + abs(y2 - y1); - end; - - { - void add_to_tab(Node toAdd, ArrayOfNode *tab); - * Ajoute un nœud à la liste ouverte. - } - procedure add_to_tab(toAdd : Node; var tab : ArrayOfNode); - var nouvelleTaille, i : Integer; newTab : Array of Node; - begin - if( length(tab) <> 0 ) then - begin - nouvelleTaille := high(tab) + 2; - setlength(newTab, nouvelleTaille); - - for i := 0 to high(tab) do - newTab[i] := tab[i]; - - finalize(tab); - end - else - begin - setlength(newTab, 1); - nouvelleTaille := 1; - end; - - newTab[high(newTab)] := toAdd; - tab := newTab; - end; - - { - void remove_from_tab(int lowestInd, ArrayOfNode *openList); - * Supprime un nœud dans la liste ouverte. - } - procedure remove_from_tab(lowestInd : Integer; var openList : ArrayOfNode); - var nouvelleTaille, i, i2 : Integer; newOpenList : Array of Node; - begin - nouvelleTaille := length(openList) - 1; - if( nouvelleTaille < 0 ) then - begin - finalize(openList); - exit; - end; - setlength(newOpenList, nouvelleTaille); - - i2 := 0; - for i := 0 to nouvelleTaille - 1 do - begin - if( i = lowestInd ) then - inc(i2); - - newOpenList[i] := openlist[i2]; - - inc(i2); - end; - finalize(openList); - - openList := newOpenList; - end; - - { - void modif_tab(Node nodeToUp, ArrayOfNode *tab); - * Remplace le contenu d'un nœud. - } - procedure modif_tab(nodeToUp : Node; var tab : ArrayOfNode); - var i : Integer; - begin - for i := 0 to high(tab) do - if( (tab[i].x = nodeToUp.x) AND (tab[i].y = nodeToUp.y)) then - begin - tab[i] := nodeToUp; - exit; - end; - end; - - { - void init_nodes(DoubleArrayOfNode *nodesList); - * Initialise un tableau de nodes. - } - procedure init_nodes(var nodesList : DoubleArrayOfNode); - var i, j : Integer; - begin - for i := 0 to high(nodesList) do - begin - for j := 0 to high(nodesList[0]) do - begin - nodesList[i, j].x := i; - nodesList[i, j].y := j; - nodesList[i, j].f := 0; - nodesList[i, j].g := 0; - nodesList[i, j].h := 0; - nodesList[i, j].visited := FALSE; - nodesList[i, j].closed := FALSE; - nodesList[i, j].parent.x := -1; - nodesList[i, j].parent.y := -1; - end; - end; - end; - - { - void remove_from_open_list(int lowestInd, ArrayOfNode *openList, DoubleArrayOfNode *nodesList); - * Supprime un nœud de la liste ouverte et le place dans la liste fermée. - } - procedure remove_from_open_list(lowestInd : Integer; var openList : ArrayOfNode; var nodesList : DoubleArrayOfNode); - var caseToRemove : Node; - begin - caseToRemove := openList[lowestInd]; - remove_from_tab(lowestInd, openList); - nodesList[caseToRemove.x, caseToRemove.y].closed := TRUE; - end; - - { - ArrayOfNode find_path(ArrayOfInteger plateau, Coordonnees caseFrom, Coordonnees caseTo); - * Implémentation de l'algorithme A*. Trouve une solution pour aller d'un point From à un point To. - } - function find_path(plateau : ArrayOfInteger; caseFrom : Coordonnees; caseTo : Coordonnees) : ArrayOfNode; - var nodesList : DoubleArrayOfNode; - openList : ArrayOfNode; - lowestInd, i, gScore : Integer; - currentNode, neighbor : Node; - path, reversedPath, neighbors : Array of Node; - beenVisited : Boolean; - begin - setlength(nodesList, high(plateau) + 1, high(plateau[0]) + 1); - init_nodes(nodesList); - - openList := NIL; - reversedPath := NIL; - - add_to_tab(nodesList[caseFrom.x, caseFrom.y], openList); - - while(length(openList) > 0) do - begin - //On récupère le nœud de la liste ouverte qui a le coût f le plus faible. - lowestInd := 0; - - for i := 0 to high(openList) do - if(openList[i].f < openList[lowestInd].f) then - lowestInd := i; - - //Ce nœud devient le nœud courant. - currentNode := openList[lowestInd]; - - { - Si l'on est arrivé à la case trésor, on recompose le chemin. - * On commence par retracer l'itinéraire en récupérant les parents successifs, jusqu'à la case de départ. - * Et on inverse le chemin pour l'avoir dans le bon sens. - } - if((currentNode.x = caseTo.x) AND (currentNode.y = caseTo.y))then - begin - currentNode := nodesList[currentNode.x, currentNode.y]; - while(((currentNode.parent.x) <> -1) AND ((currentNode.parent.y) <> -1)) do - begin - add_to_tab(currentNode, reversedPath); - currentNode := nodesList[currentNode.parent.x, currentNode.parent.y]; - end; - - //Le chemin est à l'envers, on le retourne. - setlength(path, high(reversedPath) + 1); - writeln(high(reversedPath)); - - for i := 0 to high(reversedPath) do - begin - path[high(reversedPath) - i] := reversedPath[i]; - end; - - exit(path); - end; - - { - Cas normal : - * On met le nœud actuel dans la liste fermée - * Et on vérifie les nœuds voisins. - } - remove_from_open_list(lowestInd, openList, nodesList); - currentNode.closed := true; - - neighbors := get_neighbors(nodesList, currentNode); - - for i := 0 to high(neighbors) do - begin - neighbor := neighbors[i]; - - if((neighbor.closed) OR (plateau[neighbor.x, neighbor.y] = 1) ) then - //Le nœud n'est pas valide (déjà dans la liste fermé ou mur), on passe au nœud suivant. - continue; - - //le coût G est la distance entre le nœud de départ et le nœud actuel. - gScore := currentNode.g + 1; //auquel on ajoute 1 (la distance entre le nœud actuel et le nœud voisin) - - beenVisited := neighbor.visited; - - if(NOT(neighbor.visited) OR (gScore < neighbor.g)) then - begin - //Le nouveau chemin vers le voisin est le meilleur. On enregistre les nouvelles informations. - neighbor.visited := true; - neighbor.parent.x := currentNode.x; - neighbor.parent.y := currentNode.y; - neighbor.h := neighbor.h OR distance(neighbor.x, neighbor.y, caseTo.x, caseTo.y); - neighbor.g := gScore; - neighbor.f := neighbor.g + neighbor.h; - - if(NOT(beenVisited)) then - begin - //Le nœud n'a pas été visité, on l'ajoute à la liste ouverte. - add_to_tab(neighbor, openList); - nodesList[neighbor.x, neighbor.y] := neighbor; - end - else - begin - //Le nœud appartient déjà la liste ouverte, on le met à jour. - modif_tab(neighbor, openList); - nodesList[neighbor.x, neighbor.y] := neighbor; - end; - end; - end; - end; - //Aucun chemin trouvé. - find_path := NIL; - end; - - { - ArrayOfNode get_neighbors(DoubleArrayOfNode plateau, Node currentNode); - * Retourne la liste des voisins d'une case. - } - function get_neighbors(nodesList : DoubleArrayOfNode; currentNode : Node) : ArrayOfNode; - var x, y : Integer; casesVoisines : Array of Node; - begin - x := currentNode.x; - y := currentNode.y; - - if(x - 1 >= 0) then - begin - add_to_tab(nodesList[x - 1, y], casesVoisines); - end; - - if(x + 1 <= high(nodesList[0])) then - begin - add_to_tab(nodesList[x + 1, y], casesVoisines); - end; - - if(y - 1 >= 0) then - begin - add_to_tab(nodesList[x, y - 1], casesVoisines); - end; - - if(y + 1 <= high(nodesList)) then - begin - add_to_tab(nodesList[x, y + 1], casesVoisines); - end; - - get_neighbors := casesVoisines; - end; - -begin - {Corps du module astar} -end. diff --git a/sample/sphinx-astar-master/joueur.pas b/sample/sphinx-astar-master/joueur.pas deleted file mode 100644 index 3a49245a..00000000 --- a/sample/sphinx-astar-master/joueur.pas +++ /dev/null @@ -1,280 +0,0 @@ -Unit joueur; - -interface - uses Crt, listesChainees; - - function case_depart(plateau : ArrayOfInteger) : Coordonnees; - function copier_plateau(plateauACopier : ArrayOfInteger) : ArrayOfInteger; - function creer_plateau(hauteur, largeur, nbDeMurs : Integer) : ArrayOfInteger; - procedure afficher_plateau(plateau : ArrayOfInteger); - procedure bouger_joueur(plateauIA : ArrayOfInteger; var plateauIAJoueur : ArrayOfInteger; caseActuelleJoueur : Coordonnees); - procedure tour_joueur(var joueurGagne : Boolean; plateauIA : ArrayOfInteger; var plateauIAJoueur : ArrayOfInteger; var caseActuelleJoueur : Coordonnees); - -implementation - - { - void afficher_plateau(ArrayOfInteger plateau); - * Affiche le contenu d'un plateau - } - - procedure afficher_plateau(plateau : ArrayOfInteger); - var i, j : Integer; - Const VIDE = ' '; MUR = '■'; ENTREE = '▲'; TRESOR = '☼'; CACHE = '?'; JOUEUR = '☻'; - begin - - //Création du séparateur haut et de la numérotation - writeln; - writeln; - write(' '); - for j := 1 to high(plateau[0]) + 1 do write(j, ' '); - writeln; - write(' '); - for j := 0 to high(plateau[0]) + 2 do write(MUR, ' '); - writeln; - - for i := 0 to high(plateau) do - begin - write(' ', i + 1); - if( ((i + 1) / 10) < 1 ) then//pour éviter le décalage des nombres à deux chiffres. - write(' '); - write(' ', MUR, ' '); - for j := 0 to high(plateau[i]) do - begin - case plateau[i,j] of - 0 : write(VIDE, ' '); - 1 : write(MUR, ' '); - 2 : write(ENTREE, ' '); - 3 : write(TRESOR, ' '); - 4 : write(CACHE, ' '); - 5 : write(JOUEUR, ' '); - end; - end; - write(MUR); - writeln; - end; - - //Création séparateur bas - write(' '); - for j := 0 to high(plateau[0]) + 2 do write(MUR, ' '); - - writeln; - writeln; - end; - - { - ArrayOfInteger copier_plateau(ArrayOfInteger plateauACopier); - * Copie un plateau en ne dévoilant que les cases d'entrée et de trésor - } - function copier_plateau(plateauACopier : ArrayOfInteger) : ArrayOfInteger; - var nouveauPlateau : ArrayOfInteger; i, j :Integer; - begin - setlength(nouveauPlateau, high(plateauACopier) + 1, high(plateauACopier[0]) + 1); - - for i := 0 to high(nouveauPlateau) do - begin - for j := 0 to high(nouveauPlateau[0]) do - begin - if( (plateauACopier[i, j] = 2) OR (plateauACopier[i, j] = 3) ) then - nouveauPlateau[i, j] := plateauACopier[i, j] - else - nouveauPlateau[i, j] := 4; - end; - end; - - copier_plateau := nouveauPlateau; - end; - - { - ArrayOfInteger creer_plateau(int hauteur, int largeur, int nbDeMurs); - * Crée un plateau à partir des indications du joueur. - } - function creer_plateau(hauteur, largeur, nbDeMurs : Integer) : ArrayOfInteger; - var plateau : Array of Array of Integer; - i, j, currentx, currenty : Integer; - currentChoiceOk : Boolean; - begin - setlength(plateau, hauteur, largeur); - - //Initialisation du plateau. - for i := 0 to high(plateau) do - begin - for j := 0 to high(plateau[i]) do plateau[i,j] := 4; - end; - - currentChoiceOk := FALSE; - while(NOT(currentChoiceOk)) do - begin - afficher_plateau(plateau); - writeln; - writeln('Entrez les coordonnées de la porte d''entrée :'); - write('x : '); - readln(currentx); - write('y : '); - readln(currenty); - - //Réglage du décalage du zéro - currentx := currentx - 1; - currenty := currenty - 1; - - ClrScr; - - if( (currentx >= 0) AND (currentx <= high(plateau)) AND (currenty >= 0) AND (currenty <= high(plateau[0]))) then - begin - plateau[currentx, currenty] := 2; - currentChoiceOk := TRUE; - end - else - writeln('Case invalide.'); - end; - - writeln; - ClrScr; - currentChoiceOk := FALSE; - while(NOT(currentChoiceOk)) do - begin - afficher_plateau(plateau); - writeln; - writeln('Entrez les coordonnées du trésor :'); - write('x : '); - readln(currentx); - write('y : '); - readln(currenty); - - //Réglage du décalage du zéro - currentx := currentx - 1; - currenty := currenty - 1; - - ClrScr; - - if( (currentx >= 0) AND (currentx <= high(plateau)) AND (currenty >= 0) AND (currenty <= high(plateau[0]))) then - begin - if(plateau[currentx, currenty] <> 2) then - begin - plateau[currentx, currenty] := 3; - currentChoiceOk := TRUE; - end - else - writeln('Cette case est déjà occupée par la case départ.'); - end - else - writeln('Case invalide'); - end; - creer_plateau := plateau; - end; - - { - void tour_joueur(bool *joueurGagne, ArrayOfInteger plateauIA, ArrayOfInteger *plateauIAJoueur, Coordonnees *caseActuelleJoueur); - * Joue le coup du joueur. - } - procedure tour_joueur(var joueurGagne : Boolean; plateauIA : ArrayOfInteger; var plateauIAJoueur : ArrayOfInteger; var caseActuelleJoueur : Coordonnees); - var toucheEntree : Char; - caseDemandee : Coordonnees; - continuer : Boolean; - begin - writeln('C''est à votre tour de jouer !'); - writeln; - - caseDemandee.x := caseActuelleJoueur.x; - caseDemandee.y := caseActuelleJoueur.y; - - continuer := TRUE; - - while( continuer ) do - begin - ClrScr; - //On teste d'abord les collisions externes - if( (caseDemandee.x >= 0) AND (caseDemandee.x <= high(plateauIAJoueur)) AND (caseDemandee.y >= 0) AND (caseDemandee.y <= high(plateauIAJoueur[0]))) then - begin - //Puis si c'est un mur - if( plateauIA[caseDemandee.x, caseDemandee.y] <> 1 ) then - begin - plateauIAJoueur[caseDemandee.x, caseDemandee.y] := plateauIA[caseDemandee.x, caseDemandee.y]; - caseActuelleJoueur := caseDemandee; - - if( plateauIAJoueur[caseDemandee.x, caseDemandee.y] = 0 ) then - writeln('La case demandée est vide.') - else if( plateauIAJoueur[caseDemandee.x, caseDemandee.y] = 2 ) then - writeln('Vous êtes à la case départ.') - else if( plateauIAJoueur[caseDemandee.x, caseDemandee.y] = 3 ) then - begin - writeln('Bravo ! Vous avez trouvé le trésor.'); - afficher_plateau(plateauIA); - joueurGagne := TRUE; - continuer := FALSE; - exit; - end; - bouger_joueur(plateauIA, plateauIAJoueur, caseActuelleJoueur); - end - else - begin - plateauIAJoueur[caseDemandee.x, caseDemandee.y] := 1; - writeln('La case que vous avez demandée contient un mur.'); - continuer := FALSE; - exit; - end; - end - else - begin - writeln('Cette case est en dehors du plateau. Choisissez-en une autre.'); - end; - - afficher_plateau(plateauIAJoueur); - - writeln; - write('Utilisez les flèches directionnelles pour vous déplacer.'); - - repeat - toucheEntree := ReadKey; - case ReadKey of - #72 : caseDemandee.x := caseActuelleJoueur.x - 1; - #80 : caseDemandee.x := caseActuelleJoueur.x + 1; - #75 : caseDemandee.y := caseActuelleJoueur.y - 1; - #77 : caseDemandee.y := caseActuelleJoueur.y + 1; - end; - until( toucheEntree = #0 ) - end; - end; - - { - Coordonnees case_depart(ArrayOfInteger plateau); - * Renvoie les coordonnées de la case départ du plateau envoyé en paramètre. - } - function case_depart(plateau : ArrayOfInteger) : Coordonnees; - var i, j : Integer; caseDepart : Coordonnees; - begin - for i := 0 to high(plateau) do - begin - for j := 0 to high(plateau[0]) do - begin - if( plateau[i, j] = 2) then - begin - caseDepart.x := i; - caseDepart.y := j; - exit(caseDepart); - end; - end; - end; - end; - - { - void bouger_joueur(ArrayOfInteger plateauIA, ArrayOfInteger *plateauIAJoueur, Coordonnees caseActuelleJoueur); - * Change la position du joueur sur le plateau et redéfinit le contenu de la case précédément occupée par celui-ci. - } - procedure bouger_joueur(plateauIA : ArrayOfInteger; var plateauIAJoueur : ArrayOfInteger; caseActuelleJoueur : Coordonnees); - begin - //On commence par chercher la position stockée actuellement - if( (caseActuelleJoueur.x - 1 >= 0) AND (plateauIAJoueur[caseActuelleJoueur.x - 1, caseActuelleJoueur.y] = 5) ) then - plateauIAJoueur[caseActuelleJoueur.x - 1, caseActuelleJoueur.y] := plateauIA[caseActuelleJoueur.x - 1, caseActuelleJoueur.y] - else if( (caseActuelleJoueur.x + 1 <= high(plateauIAJoueur)) AND (plateauIAJoueur[caseActuelleJoueur.x + 1, caseActuelleJoueur.y] = 5) ) then - plateauIAJoueur[caseActuelleJoueur.x + 1, caseActuelleJoueur.y] := plateauIA[caseActuelleJoueur.x + 1, caseActuelleJoueur.y] - else if( (caseActuelleJoueur.y - 1 >= 0) AND (plateauIAJoueur[caseActuelleJoueur.x, caseActuelleJoueur.y - 1] = 5) ) then - plateauIAJoueur[caseActuelleJoueur.x, caseActuelleJoueur.y - 1] := plateauIA[caseActuelleJoueur.x, caseActuelleJoueur.y - 1] - else if( (caseActuelleJoueur.y + 1 <= high(plateauIAJoueur[0])) AND (plateauIAJoueur[caseActuelleJoueur.x, caseActuelleJoueur.y + 1] = 5) ) then - plateauIAJoueur[caseActuelleJoueur.x, caseActuelleJoueur.y + 1] := plateauIA[caseActuelleJoueur.x, caseActuelleJoueur.y + 1]; - - //Et on place le joueur - plateauIAJoueur[caseActuelleJoueur.x, caseActuelleJoueur.y] := 5; - end; -begin - {Corps du module joueur} -end. diff --git a/sample/sphinx-astar-master/listesChainees.pas b/sample/sphinx-astar-master/listesChainees.pas deleted file mode 100644 index f2ff522d..00000000 --- a/sample/sphinx-astar-master/listesChainees.pas +++ /dev/null @@ -1,119 +0,0 @@ -Unit listesChainees; - -interface - //Déclaration des structures pour tout le programme - Type - Coordonnees = record - x : Integer; - y : Integer; - end; - - Contraintes = record - haut : Boolean; - bas : Boolean; - gauche : Boolean; - droite : Boolean; - end; - - PCellule = ^Cellule; - Cellule = record - coordonneesCase : Coordonnees; - contraintesCase : Contraintes; - precedent, suivant : PCellule; - end; - - Node = record - f, g, h : Integer; - x, y : Integer; - visited, closed : Boolean; - parent : Coordonnees; - end; - - //Déclaration des types supplémentaires - ArrayOfInteger = Array of Array of Integer; - ArrayOfNode = Array of Node; - DoubleArrayOfNode = Array of Array of Node; - - procedure ajouter_item(var liste: PCellule; x, y: Integer; var derniereCase : PCellule); - procedure remove_item_end(liste: PCellule; var derniereCase : PCellule); - procedure display_list(liste: PCellule); - procedure clear_list(liste: PCellule); - -implementation - - { - procedure ajouter_item(var liste: PCellule; x, y: Integer); - * Ajoute un item en fin de liste - } - procedure ajouter_item(var liste: PCellule; x, y: Integer; var derniereCase : PCellule); - var p: PCellule; - begin - new(p); - p^.coordonneesCase.x := x; - p^.coordonneesCase.y := y; - p^.suivant := liste; - p^.suivant^.precedent := p; - derniereCase := p; - liste := p; - end; - - { - procedure remove_item_end(liste: PCellule); - * Supprime un item en fin de liste - } - procedure remove_item_end(liste: PCellule; var derniereCase : PCellule); - var p, r: PCellule; - begin - p := liste; - if( p^.suivant <> NIL ) then//L'autre cas ne nous intéresse pas. - begin - while (p <> nil) do - begin - r := p^.suivant; - if r = NIL then - begin - p^.precedent^.suivant := NIL; - - derniereCase := p^.precedent; - dispose(p); - end; - p := r; - end; - end; - end; - - { - procedure display_list(liste : PCellule); - * Affiche le contenu d'une liste - } - procedure display_list(liste : PCellule); - var p: PCellule; - begin - p := liste; - while (p <> nil) do - begin - write('[', p^.coordonneesCase.x,', ', p^.coordonneesCase.y, '] ; '); - p := p^.suivant; - end; - writeln; - end; - - { - procedure clear_list(liste: PCellule); - * Vide une liste de cases de son contenu - } - procedure clear_list(liste: PCellule); - var p, r: PCellule; - begin - p := liste; - while (p <> nil) do - begin - r := p^.suivant; - dispose(p); - p := r; - end; - end; - -begin - {Corps du module listesChainees} -end. diff --git a/sample/sphinx-astar-master/main.pas b/sample/sphinx-astar-master/main.pas deleted file mode 100644 index 0d87a5ad..00000000 --- a/sample/sphinx-astar-master/main.pas +++ /dev/null @@ -1,312 +0,0 @@ -Program Sphinx; -{ - Jeu de sphinx en console - - Copyright 2012 Stanislas Michalak - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. -} -Uses Crt, IA, joueur, listesChainees, Astar; -var choixMenu : Integer; continuer : Boolean; - -{ - void parametres(); - * Affiche les paramètres actuels, demande la saisie et enregistre de nouveaux paramètres dans le fichier de config. -} -procedure parametres(); -var settings : text; -params : array [0..2] of Integer; -i, error : Integer; -configNotOk : Boolean; -choix : Char; -begin - ClrScr; - - { - Le changement des paramètres se fait en deux temps : - * d'abord, on vérifie que le fichier de config existe. Si c'est le cas, on affiche les valeurs actuelles. - * ensuite, on propose à l'utilisateur de changer les valeurs. - } - - //Chargement du fichier de configuration en lecture. - {$I-} - assign(settings, './settings.txt'); - reset(settings); - {$I+} - - error := IORESULT; - if error <> 0 then//Si l'on a trouvé une erreur, on la traite. - begin - if( error = 2 ) then//Le fichier n'existe pas, on va donc en créer un nouveau - begin - rewrite(settings); - close(settings); - end - else - begin - //Impossible de créer le fichier. On le signale et on retourne au menu - writeln('Impossible de créer le fichier de sauvegarde des paramètres.'); - readln; - exit; - end; - end - else - begin - writeln('Paramètres'); - writeln; - writeln('Voici la configuration actuelle :'); - - for i:= 0 to 2 do - read(settings, params[i]);//On stocke les paramètres dans des variables utilisables par la suite. - - close(settings); - - //Affichage des valeurs actuelles - writeln('Hauteur : ', params[0], ' cases'); - writeln('Largeur : ', params[1], ' cases'); - writeln('Nombre de murs : ', params[2]); - - writeln; - - //On propose à l'utilisateur de changer ou non les paramètres actuels. - writeln('Voulez-vous changer ces paramètres ? (o/n)'); - repeat - choix := readkey; - until((choix = 'o') OR (choix = 'n')); - - //Si c'est non, on retourne au menu. - if( choix = 'n' ) then exit; - end; - - configNotOk := TRUE; - - //Tant que les paramètres ne sont pas valides, on en demande de nouveaux. - while( configNotOk ) do - begin - writeln('Nouvelle configuration :'); - write('Hauteur : '); - readln(params[0]); - write('Largeur : '); - readln(params[1]); - write('Nombre de murs : '); - readln(params[2]); - - if( (params[0] > 0) AND (params[1] > 0) AND (params[2] > 0) ) then - begin - if( params[2] >= trunc(0.31 * params[0] * params[1]) ) then - begin - if( params[2] <= (params[0] * params[1]) - 2 ) then - configNotOk := FALSE - else - writeln('Le nombre de murs demandé est trop élevé pour générer un labyrinthe.'); - end - else - writeln('Le nombre de murs demandé est insuffisant pour générer un labyrinthe.'); - end - else - writeln('Les paramètres doivent être strictement positifs.'); - - writeln; - end; - - //On recharge le fichier de configuration en écriture cette fois. - {$I-} - assign(settings, './settings.txt'); - rewrite(settings); - {$I+} - - error := IORESULT; - if( error = 5 ) then//Le fichier est en lecture seule, on prévient donc l'utilisateur et on retourne au menu. - begin - writeln('Le fichier de configuration est en lecture seule. Impossible de mettre-à-jour les paramètres.'); - readln; - exit; - end; - - //On écrit les nouveaux paramètres dans le fichier. - writeln(settings, params[0]); - writeln(settings, params[1]); - writeln(settings, params[2]); - - writeln; - writeln('La nouvelle configuration a été enregistrée'); - readln; - - close(settings); -end; - -{ - void nouvelle_partie(); - * Gère le déroulement d'une partie -} -procedure nouvelle_partie(); -var hauteur, largeur, nbDeMurs : Integer; -plateauIA, plateauIAJoueur, plateauJoueurIA : Array of Array of Integer; -settings : text; params : array [0..2] of Integer; i, error : Integer; -caseActuelleJoueur, caseActuelleIA, caseArriveeIA : Coordonnees; -joueurGagne, IAGagne : Boolean; -begin - ClrScr; - - - { - * Chargement des paramètres et création des plateaux - } - - //Chargement du fichier de configuration - repeat - {$I-} - assign(settings, './settings.txt'); - reset(settings); - {$I+} - - //Si le fichier de configuration n'existe pas, on redirige vers le menu paramètres. - error := IORESULT; - if error <> 0 then - parametres(); - until(error = 0); - - ClrScr; - - //Sinon, on récupère les paramètres et on les stocke dans les variables. - for i:= 0 to 2 do - read(settings, params[i]); - - close(settings); - hauteur := params[0]; - largeur := params[1]; - nbDeMurs := params[2]; - - repeat//Tant que le plateau de l'IA n'est pas correct, on en regénère un. - plateauIA := generer_plateau(hauteur, largeur, nbDeMurs); - until( length(plateauIA) <> 0 ); - - plateauIAJoueur := copier_plateau(plateauIA); - plateauJoueurIA := creer_plateau(hauteur, largeur, nbDeMurs); - - { - * Déroulement de la partie - } - - //On positionne le joueur à la case départ. - caseActuelleJoueur := case_depart(plateauIA); - - //Même chose pour l'IA. On récupère au passage la position de la case d'arrivée, nécessaire pour A*. - caseActuelleIA := case_depart(plateauJoueurIA); - caseArriveeIA := case_arrivee(plateauJoueurIA); - - //Par défaut, personne n'a gagné - joueurGagne := FALSE; - IAGagne := FALSE; - - ClrScr; - - //Qui commence ? - case random(2) of - 0 : - begin - tour_joueur(joueurGagne, plateauIA, plateauIAJoueur, caseActuelleJoueur); - tour_IA(IAGagne, plateauJoueurIA, caseActuelleIA, caseArriveeIA);//Nécessaire pour éviter que le joueur joue deux fois (voir while ci-dessous) - end; - 1 : tour_IA(IAGagne, plateauJoueurIA, caseActuelleIA, caseArriveeIA); - end; - - while( NOT(joueurGagne) AND NOT(IAGagne) ) do - Begin - tour_joueur(joueurGagne, plateauIA, plateauIAJoueur, caseActuelleJoueur); - if( joueurGagne ) then - break;//Correction d'un bogue (les conditions de la boucle while ne sont pas vérifiées à chaque instant, du coup le joueur IA peut continuer de jouer si l'on ne fait rien). - tour_IA(IAGagne, plateauJoueurIA, caseActuelleIA, caseArriveeIA); - End; - readln; -end; - -{ - void regles_du_jeu(); - * Affiche la règle de jeu. -} -procedure regles_du_jeu(); -var rules : text; x : string; -begin - ClrScr; - - //Chargement du fichier contenant les règles du jeu. - {$I-} - assign(rules, './rules.txt'); - reset(rules); - {$I+} - - //S'il y a une erreur de chargement, on le signale à l'utilisateur et on retourne au menu. - if( IORESULT <> 0 ) then - begin - writeln('Erreur de chargement des règles du jeu'); - readln; - exit; - end; - - //Affichage du contenu du fichier (donc affichage des règles du jeu). - Repeat - readln(rules, x); - writeln(x); - Until(eof(rules)); - - close(rules); - readln; -end; - -{ - Ordonnanceur général - * Lance les fonctions de base et permet de quitter le programme. -} -begin - RANDOMIZE; - continuer := TRUE; - - while(continuer = TRUE) do - begin - ClrScr; - writeln(' __ '); - writeln(' ___ /_I\ ___'); - writeln(' / \ __ /_I__\ __ / \'); - writeln('/ \ / \ _ /I___I_\ _ / \ / \'); - writeln(' \_/ \_/ \_/___I__I_\_/ \_/ \_/'); - writeln(' __________________/__I___I___\________________'); - writeln(' /_I___I___I__\'); - writeln(' /I___I___I___I_\'); - writeln(' /___I_______I___I\'); - writeln(' /__I___Sphinx__I___\'); - writeln(' /_I___I_______I___I__\'); - writeln(' /I___I___I___I___I___I_\'); - writeln(' /___I___I___I___I___I___I\'); - writeln(' /__I___I___I___I___I___I___\'); - writeln(' /_I___I___I___I___I___I___I__\'); - writeln; - writeln(' 1 - Nouvelle partie'); - writeln(' 2 - Paramètres'); - writeln(' 3 - Règles du jeu'); - writeln(' 4 - Quitter'); - writeln; - write(' Que voulez-vous faire ? '); - readln(choixMenu); - - case choixMenu of - 1 : nouvelle_partie(); - 2 : parametres(); - 3 : regles_du_jeu(); - 4 : continuer := FALSE; - end; - end; -end. diff --git a/sample/sphinx-astar-master/rules.txt b/sample/sphinx-astar-master/rules.txt deleted file mode 100644 index 3aa51814..00000000 --- a/sample/sphinx-astar-master/rules.txt +++ /dev/null @@ -1,26 +0,0 @@ -Règle du jeu : - -Le jeu consiste à cacher un trésor dans les couloirs d'un labyrinthe et -d'empêcher votre adversaire de le trouver. - -* Vous devez tout d'abord créer votre labyrinthe : placez 15 murs sur le -plan de la pyramide, tout en faisant attention de ne pas bloquer l'accès -au trésor. L'ordinateur génère à son tour un labyrinthe à votre intention. - -* L'ordinateur vous communique ensuite la position de l'entrée du labyrinthe, -ainsi que celle du trésor. Votre but est d'arriver au trésor avant -l'ordinateur. - -* À chaque tour, vous devez demander une case à l'ordinateur, qui vous -renseigne sur son contenu : - - * Si c'est une case vide, vous pouvez avancer et demander le contenu - d'une autre case adjacente à votre position. - - * Si la case contient un mur, votre tour s'arrête et c'est au tour de - l'ordinateur. - - * Enfin, si la case contient le trésor, vous gagnez la partie et le - jeu s'arrête. - -[Appuyez sur entrée pour revenir au menu] diff --git a/sample/sphinx-astar-master/settings.txt b/sample/sphinx-astar-master/settings.txt deleted file mode 100644 index 594aaa2e..00000000 --- a/sample/sphinx-astar-master/settings.txt +++ /dev/null @@ -1,3 +0,0 @@ -7 -7 -15 diff --git a/sample/terpas/MINE8.PAS b/sample/terpas/MINE8.PAS deleted file mode 100644 index f86783c4..00000000 --- a/sample/terpas/MINE8.PAS +++ /dev/null @@ -1,644 +0,0 @@ -program digger; -uses crt; - -label metka1, l1, l2, m4, m5; -const - x = 72; - y = 24; -var - m : array [1..x, 1..y] of char; - i, j, vert, hor, zx, zy, dist, bl : byte; - l, h, c, g, b, phon, h1, gr, d : char; - fil : text; - S : string[x]; - k, health, ammo, d1, cont, detonate : integer; - n : boolean; -begin - textbackground(8); - textcolor(7); - clrscr; - assign(fil, 'ground1.txt'); - reset(fil); - b := '-'; - d := chr(9); - write('Put health,ammo>>'); - readln(health, ammo); - randomize; - metka1 : for j:=1 to y do -begin - READLN(fil, S); - for i:=1 to x do - begin - m[i, j] := S[i]; - write(m[i, j]); - end; - writeln; -end; - l := chr(2); - c := chr(1); - g := chr(178); - phon := chr(177); - gr := chr(176); - hor := 20; - vert := 8; - m[hor, vert] := l; - h1 := 's'; - h := 's'; - while 2 > 1 do - begin - h := h1; - if keypressed then h := readkey; - case h of - 'a' : - begin - if (m[hor - 1, vert] = ' ') or (m[hor - 1, vert] = phon) then - begin - m[hor, vert] := ' '; - if m[hor - 1, vert] = phon then m[hor, vert] := phon; - hor := hor - 1; - m[hor, vert] := l; - end; - end; - 'd' : - begin - if (m[hor + 1, vert] = ' ') or (m[hor + 1, vert] = phon) then - begin - m[hor, vert] := ' '; - if m[hor + 1, vert] = phon then m[hor, vert] := phon; - hor := hor + 1; - m[hor, vert] := l; - end; - end; - 'q' : - begin - if ((m[hor, vert - 1] = ' ') or (m[hor, vert - 1] = phon)) and - ((m[hor - 1, vert - 1] = ' ') or (m[hor - 1, vert - 1] = phon)) then if m[hor, vert - 1] = phon then - begin - m[hor, vert] := phon; - vert := vert - 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - m[hor, vert] := phon; - hor := hor - 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - end - else begin - m[hor, vert] := ' '; - vert := vert - 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - m[hor, vert] := ' '; - hor := hor - 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - end; - end; - 'e' : - begin - if ((m[hor, vert - 1] = ' ') or (m[hor, vert - 1] = phon)) and - ((m[hor + 1, vert - 1] = ' ') or (m[hor + 1, vert - 1] = phon)) then if m[hor, vert - 1] = phon then - begin - m[hor, vert] := phon; - vert := vert - 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - m[hor, vert] := phon; - hor := hor + 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - end - else begin - m[hor, vert] := ' '; - vert := vert - 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - m[hor, vert] := ' '; - hor := hor + 1; - m[hor, vert] := l; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textbackground(7); - chr(9) : textcolor(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - end; - end; - 'w' : if (m[hor, vert - 1] = ' ') or (m[hor, vert - 1] = phon) then - begin - m[hor, vert] := g; - vert := vert - 1; - m[hor, vert] := l; - end; - 'g' : if (m[hor, vert + 1] <> gr) and (m[hor, vert + 1] <> ' ') then m[hor, vert + 1] := phon; - 't' : if (m[hor, vert - 1] <> gr) and (m[hor, vert - 1] <> ' ') then m[hor, vert - 1] := phon; - 'f' : if (m[hor - 1, vert] <> gr) and (m[hor - 1, vert] <> ' ') then m[hor - 1, vert] := phon; - 'h' : if (m[hor + 1, vert] <> gr) and (m[hor + 1, vert] <> ' ') then m[hor + 1, vert] := phon; - 'i' : if (m[hor, vert - 1] <> c) then m[hor, vert - 1] := g; - 'k' : if (m[hor, vert + 1] <> c) then m[hor, vert + 1] := g; - 'j' : if (m[hor - 1, vert] <> c) then m[hor - 1, vert] := g; - 'l' : if (m[hor + 1, vert] <> c) then m[hor + 1, vert] := g; - 'z' : if ammo > 0 then - begin - ammo := ammo - 1; - for dist:=1 to 15 do - begin - m[hor - dist, vert] := b; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - if (m[hor - dist - 1, vert] = d) or (m[hor - dist - 1, vert] = c) then - begin - m[hor - dist - 1, vert] := phon; - for j:=1 to 2 do - begin - if m[hor - dist - 1 + j, vert] <> ' ' - then if m[hor - dist - 1 + j, vert] = d then - begin - m[hor - dist - 1 + j, vert] := phon; - dist := dist - j; - end - else m[hor - dist - 1 + j, vert] := phon; - if m[hor - dist - 1 - j, vert] <> ' ' - then m[hor - dist - 1 - j, vert] := phon; - if m[hor - dist - 1, vert + j] <> ' ' - then m[hor - dist - 1, vert + j] := phon; - if m[hor - dist - 1, vert - j] <> ' ' - then m[hor - dist - 1, vert - j] := phon; - end; - if m[hor - dist, vert + 1] <> ' ' - then m[hor - dist, vert + 1] := phon; - if m[hor - dist - 2, vert + 1] <> ' ' - then m[hor - dist - 2, vert + 1] := phon; - if m[hor - dist, vert - 1] <> ' ' - then m[hor - dist, vert - 1] := phon; - if m[hor - dist - 2, vert - 1] <> ' ' - then m[hor - dist - 2, vert - 1] := phon; - delay(100); - dist := 15; - end; - m[hor - dist, vert] := ' '; - end; - end; - 'x' : if ammo > 0 then - begin - ammo := ammo - 1; - for dist:=1 to 15 do - begin - m[hor + dist, vert] := b; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - if (m[hor + dist + 1, vert] = d) or (m[hor + dist + 1, vert] = c) then - begin - m[hor + dist + 1, vert] := phon; - for j:=1 to 2 do - begin - if m[hor + dist + 1 + j, vert] <> ' ' - then m[hor + dist + 1 + j, vert] := phon; - if m[hor + dist + 1 - j, vert] <> ' ' - then m[hor + dist + 1 - j, vert] := phon; - if m[hor + dist + 1, vert + j] <> ' ' - then m[hor + dist + 1, vert + j] := phon; - if m[hor + dist + 1, vert - j] <> ' ' - then m[hor + dist + 1, vert - j] := phon; - end; - if m[hor + dist, vert + 1] <> ' ' - then m[hor + dist, vert + 1] := phon; - if m[hor + dist + 2, vert + 1] <> ' ' - then m[hor + dist + 2, vert + 1] := phon; - if m[hor + dist, vert - 1] <> ' ' - then m[hor + dist, vert - 1] := phon; - if m[hor + dist + 2, vert - 1] <> ' ' - then m[hor + dist + 2, vert - 1] := phon; - delay(100); - dist := 15; - end; - - m[hor + dist, vert] := ' '; - end; - end; - 'c' : - begin - read(bl); - g := chr(bl); - end; - end; - - for j:=1 to 24 do - for i:=1 to 72 do if m[i, j] = c then - begin - if hor - 1 > i then - begin - if (m[i + 1, j] = ' ') or (m[i + 1, j] = phon) then - begin - m[i, j] := ' '; - if m[i + 1, j] = phon then m[i, j] := phon; - m[i + 1, j] := c; - i := i + 1; - end - else if (m[i + 1, j - 1] = ' ') or (m[i + 1, j - 1] = phon) then - begin - m[i, j] := ' '; - if m[i + 1, j - 1] = phon then m[i, j] := phon; - m[i + 1, j - 1] := c; - end; - end; - if hor + 1 < i then - begin - if (m[i - 1, j] = ' ') or (m[i - 1, j] = phon) then - begin - m[i, j] := ' '; - if m[i - 1, j] = phon then m[i, j] := phon; - m[i - 1, j] := c; - end - else if (m[i - 1, j - 1] = ' ') or (m[i - 1, j - 1] = phon) then - begin - m[i, j] := ' '; - if m[i - 1, j - 1] = phon then m[i, j] := phon; - m[i - 1, j - 1] := c; - end; - end; - end; - for j:=1 to 24 do - for i:= 1 to 72 do - begin - if (m[i, j] = c) and ((m[i, j + 1] = phon) or (m[i, j + 1] = ' ')) then - begin - zx := i; - zy := j; - while (m[zx, zy + 1] = phon) or (m[zx, zy + 1] = ' ') do - begin - m[zx, zy] := m[zx, zy + 1]; - zy := zy + 1; - m[zx, zy] := c; - end; - end; - end; - zx := random(72); - zy := random(24); - if (m[zx, zy] = ' ') and (m[zx, zy + 1] <> ' ') and (m[zx, zy + 1] <> phon) and (m[zx, zy + 1] <> c) then - begin - m[zx, zy] := c; - end; - clrscr; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(blue); - write (' ammo ', ammo); - textcolor(7); - delay(100); - if vert = 23 then - begin - textcolor(green); - writeln('You have WON'); - write('You have done ', k, ' moves,Continue?1/0'); - read(cont); - if cont = 1 then - begin - assign(fil, 'ground2.txt'); - reset(fil); - goto metka1; - end; - readln; - break; - end; - if health = 0 then - begin - textcolor(red); - write('You have been killed.'); - break; - end; - if (m[hor + 1, vert] = c) or (m[hor - 1, vert] = c) or (m[hor, vert + 1] = c) or (m[hor, vert - 1] = c) then - begin - if health > 3 then health := health - 3 - else health := 0; - m[hor, vert] := phon; - for j:=1 to 2 do - begin - if m[hor + j, vert] <> ' ' - then m[hor + j, vert] := phon; - if m[hor - j, vert] <> ' ' - then m[hor - j, vert] := phon; - if m[hor, vert + j] <> ' ' - then m[hor, vert + j] := phon; - if m[hor, vert - j] <> ' ' - then m[hor, vert - j] := phon; - end; - if m[hor - 1, vert + 1] <> ' ' - then m[hor - 1, vert + 1] := phon; - if m[hor + 1, vert + 1] <> ' ' - then m[hor + 1, vert + 1] := phon; - if m[hor, vert - 1] <> ' ' - then m[hor, vert - 1] := phon; - if m[hor + 1, vert - 1] <> ' ' - then m[hor + 1, vert - 1] := phon; - delay(100); - clrscr; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - end; - if (m[hor, vert + 1] = ' ') or (m[hor, vert + 1] = phon) then while (m[hor, vert + 1] = ' ') or (m[hor, vert + 1] = phon) - do - begin - d1 := d1 + 1; - m[hor, vert] := m[hor, vert + 1]; - vert := vert + 1; - m[hor, vert] := l; - clrscr; - for j:=1 to y do - begin - for i:=1 to x do - begin - case m[i, j] of - chr(1) : textcolor(green); - chr(178) : textcolor(brown); - chr(176) : textcolor(7); - chr(9) : textbackground(red); - chr(219) : textcolor(green); - chr(247) : textbackground(blue); - else if j <= 8 then textbackground(lightblue) - else textbackground(8); - end; - write(m[i, j]); - textcolor(7); - textbackground(8); - end; - writeln; - end; - textcolor(red); - for i:=1 to health do write(chr(3)); - textcolor(7); - delay(100); - end; - if d1 > 2 then health := health - (d1 div 2); - d1 := 0; - end; - readln; -end. - diff --git a/sample/terpas/ground1.txt b/sample/terpas/ground1.txt deleted file mode 100644 index f0374e24..00000000 --- a/sample/terpas/ground1.txt +++ /dev/null @@ -1,24 +0,0 @@ - | - /  | - () | - \  | -  | - ܲ | - ܲ# ۲ | - ۲ | -۱ ۲ ۰ - -ͻ -ѹ{} -Ϲϻ -ɼ͹Ȼ -# -͹ͼ - -ͻͻ - /\ -ͻͼݱ - ݱ -ͼ - -