Oracle DBMS Maze Game

--------------------------------------------- -- INIT --------------------------------------------- create or replace procedure init() is begin create table stage1(rid varchar2(1), c1 varchar2(1), c2 varchar2(1), c3 varchar2(1), c4 varchar2(1), c5 varchar2(1), c6 varchar2(1), c7 varchar2(1), c8 varchar2(1), c9 varchar2(1), c10 varchar2(1), c11 varchar2(1), c12 varchar2(1), c13 varchar2(1), c14 varchar2(1), c15 varchar2(1), c16 varchar2(1), c17 varchar2(1), c18 varchar2(1), c19 varchar2(1), c20 varchar2(1)); insert into stage1 values('1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('4', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('8', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('9', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('10', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('11', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('12', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('13', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('14', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('15', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('16', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('17', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('18', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('19', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); insert into stage1 values('20', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0','0'); end; --------------------------------------------- -- goUp() --------------------------------------------- declare begin end; --------------------------------------------- -- goDown() --------------------------------------------- declare begin end; --------------------------------------------- -- goLeft() --------------------------------------------- declare begin end; --------------------------------------------- -- goRight() --------------------------------------------- declare begin end;
DBMS MCA 2nd YEAR PROJECT

You just need to execute all the statements

set serverout on;

call registerPlayer('username', 'password');
call login('username', 'passoword');
call showPlayer(1);
call goDown(1);
call goUp(1);
call goLeft(1);
call goRight(1);

call logout(1);

triggers:

updateScoreTrigger1
updateScoreTrigger2

You are p:player.
Eat a : apple / m:mango to increase score. Stage will automatically change when stamping g:goal.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.