Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
//(C) Artemonische, 2010
|
|
|
|
|
|
|
|
|
|
#pragma option meos
|
2020-12-01 03:29:21 +01:00
|
|
|
|
#include "kolibri.h--" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> <20> KolibriOS API
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
|
2016-03-23 22:39:47 +01:00
|
|
|
|
#ifndef AUTOBUILD
|
|
|
|
|
#include "lang.h--"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef LANG_RUS
|
|
|
|
|
?define TOP_TEXT_COL 4
|
|
|
|
|
?define TOP_TEXT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><> 10 <20><> 90 <20><> <20><><EFBFBD>浪<EFBFBD>..."
|
|
|
|
|
?define BOT_LEFT_TEXT_COL 4
|
|
|
|
|
?define BOT_LEFT_TEXT "<22>饬 <20><>: "
|
|
|
|
|
?define BOT_RIGHT_TEXT_COL 162
|
|
|
|
|
?define BOT_RIGHT_TEXT "<22><>⠫<EFBFBD><E2A0AB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>: "
|
|
|
|
|
?define BOT_LEFT_NUMBER_COL 70
|
|
|
|
|
?define BOT_RIGHT_NUMBER_COL 252
|
|
|
|
|
?define F2_TEXT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (F2)"
|
|
|
|
|
?define WIN_TEXT "<22><> <20><>諨 <20><><EFBFBD> <20><>! :)"
|
|
|
|
|
#else
|
|
|
|
|
?define TOP_TEXT_COL 2
|
|
|
|
|
?define TOP_TEXT "Collect all numbers from 10 to 90 in order..."
|
|
|
|
|
?define BOT_LEFT_TEXT_COL 2
|
|
|
|
|
?define BOT_LEFT_TEXT "Looking for number: "
|
|
|
|
|
?define BOT_RIGHT_TEXT_COL 156
|
|
|
|
|
?define BOT_RIGHT_TEXT "Remains to find: "
|
|
|
|
|
?define BOT_LEFT_NUMBER_COL 116
|
|
|
|
|
?define BOT_RIGHT_NUMBER_COL 252
|
2020-12-01 03:29:21 +01:00
|
|
|
|
?define F2_TEXT " Anew (F2) "
|
2016-03-23 22:39:47 +01:00
|
|
|
|
?define WIN_TEXT "You have found all numbers! :)"
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-12-01 03:29:21 +01:00
|
|
|
|
int find;
|
|
|
|
|
struct {
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
int button_id;
|
|
|
|
|
int mark;
|
|
|
|
|
int text;
|
2020-12-01 03:29:21 +01:00
|
|
|
|
}box[81];
|
|
|
|
|
|
|
|
|
|
#define BUTTON_NEW_GAME 582
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
int button,tempi,tempj;
|
|
|
|
|
randomize();
|
2020-12-01 03:29:21 +01:00
|
|
|
|
new_game();
|
|
|
|
|
loop() switch(@WaitEvent())
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
2020-12-01 03:29:21 +01:00
|
|
|
|
case evButton:
|
|
|
|
|
button=@GetButtonID();
|
|
|
|
|
IF (button==1)
|
|
|
|
|
{
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
IF (button==BUTTON_NEW_GAME)
|
|
|
|
|
{
|
|
|
|
|
new_game();
|
|
|
|
|
}
|
|
|
|
|
if (button>500) && (button<BUTTON_NEW_GAME) && (box[button-500].text == find)
|
|
|
|
|
{
|
|
|
|
|
box[button-500].mark=2;
|
|
|
|
|
find++;
|
|
|
|
|
IF (find==91)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
|
|
|
|
draw_window();
|
|
|
|
|
}
|
2020-12-01 03:29:21 +01:00
|
|
|
|
else
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
2020-12-01 03:29:21 +01:00
|
|
|
|
DeleteButton(button);
|
|
|
|
|
tempi=box[button-500].y*30-30;
|
|
|
|
|
tempj=30*box[button-500].x-16;
|
|
|
|
|
DrawBar(tempi,tempj,30,30,0xDCFFDC);
|
|
|
|
|
DrawBar(70,289,16,8,0xDCFFDC);
|
|
|
|
|
DrawBar(252,289,16,8,0xDCFFDC);
|
|
|
|
|
WriteNumber(70,289,0x80,0,find);
|
|
|
|
|
WriteNumber(252,289,0x80,0,90-find+1);
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
}
|
2020-12-01 03:29:21 +01:00
|
|
|
|
}
|
|
|
|
|
BREAK;
|
|
|
|
|
case evKey: //<2F> <20>ந<EFBFBD><E0AEA8>諮 <20><><EFBFBD><EFBFBD>⨥ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
IF (@GetKey()==051) new_game(); //F2
|
|
|
|
|
BREAK;
|
|
|
|
|
case evReDraw:
|
|
|
|
|
draw_window();
|
|
|
|
|
draw_buttons();
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void draw_window()
|
|
|
|
|
{
|
2020-12-01 03:29:21 +01:00
|
|
|
|
DefineAndDrawWindow(300,176,280,343,0x34,0xDCFFDC,"FindNumbers");
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
DrawBar(0,13,271,1,0x0CFF0C); //<2F><><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
|
|
|
|
DrawBar(0,285,271,1,0x0CFF0C);
|
|
|
|
|
DrawBar(0,299,271,1,0x0CFF0C); //<2F><><EFBFBD><EFBFBD><EFBFBD> ᭨<><E1ADA8>
|
|
|
|
|
if (find<=90)
|
|
|
|
|
{
|
2016-03-23 22:39:47 +01:00
|
|
|
|
WriteText(TOP_TEXT_COL,4,0x80,0x000000,TOP_TEXT);
|
|
|
|
|
WriteText(BOT_LEFT_TEXT_COL,289,0x80,0x000000,BOT_LEFT_TEXT);
|
|
|
|
|
WriteText(BOT_RIGHT_TEXT_COL,289,0x80,0x000000,BOT_RIGHT_TEXT);
|
|
|
|
|
WriteNumber(BOT_LEFT_NUMBER_COL,289,0x80,0,find);
|
|
|
|
|
WriteNumber(BOT_RIGHT_NUMBER_COL,289,0x80,0,90-find+1);
|
2020-12-01 03:29:21 +01:00
|
|
|
|
DrawNewGameButton(155,300,115,14,0xAFFFAF);
|
2016-03-23 22:39:47 +01:00
|
|
|
|
WriteText(2,304,0x80,0x000000,"Made by Artemonische,2010");
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
}
|
2011-02-01 12:20:03 +01:00
|
|
|
|
IF (find==91)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
2016-03-23 22:39:47 +01:00
|
|
|
|
WriteText(70,100,0x80,0x000000,WIN_TEXT);
|
2020-12-01 03:29:21 +01:00
|
|
|
|
DrawNewGameButton(100,110,70,20,0xE4DFE1);
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
}
|
2020-12-01 03:29:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawNewGameButton(dword x,y,width,height,color)
|
|
|
|
|
{
|
|
|
|
|
DefineButton(x,y,width,height,BUTTON_NEW_GAME,color);
|
|
|
|
|
WriteText(-11*6+width/2+x+1,height/2-3+y,0x80,0,F2_TEXT,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void new_game()
|
|
|
|
|
{
|
|
|
|
|
find=10;
|
|
|
|
|
initialization();
|
|
|
|
|
draw_window();
|
|
|
|
|
draw_buttons();
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void draw_buttons()
|
|
|
|
|
{
|
|
|
|
|
int i,tempi,tempj;
|
2011-02-01 12:20:03 +01:00
|
|
|
|
FOR (i=1;i<=81;i++)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
2011-02-01 12:38:36 +01:00
|
|
|
|
IF (box[i].mark==1)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
|
|
|
|
tempi=box[i].y*30-30;
|
|
|
|
|
tempj=30*box[i].x-16;
|
|
|
|
|
DefineButton(tempi,tempj,29,29,box[i].button_id,0xAFFFAF);
|
|
|
|
|
WriteNumber(tempi+11,tempj+11,0x80,0,box[i].text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initialization()
|
|
|
|
|
{
|
|
|
|
|
int i,j,t;
|
|
|
|
|
t=0;
|
2011-02-01 12:20:03 +01:00
|
|
|
|
FOR (i=1;i<=9;i++)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
2011-02-01 12:20:03 +01:00
|
|
|
|
FOR (j=1;j<=9;j++)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
|
|
|
|
t++;
|
|
|
|
|
box[t].x=j;
|
|
|
|
|
box[t].y=i;
|
|
|
|
|
box[t].mark=1;
|
|
|
|
|
box[t].button_id=500+t;
|
|
|
|
|
box[t].text=Generate(t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Generate(int xx)
|
|
|
|
|
{
|
|
|
|
|
int temp,k,p;
|
|
|
|
|
p=2;
|
2011-02-01 12:20:03 +01:00
|
|
|
|
WHILE (p==2)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
|
|
|
|
temp=random(81)+10;
|
|
|
|
|
p=1;
|
2011-02-01 12:20:03 +01:00
|
|
|
|
FOR (k=1; k<xx; k++)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
2011-02-01 12:20:03 +01:00
|
|
|
|
IF (box[k].text==temp)
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
{
|
|
|
|
|
p=2;
|
2011-02-01 12:20:03 +01:00
|
|
|
|
BREAK;
|
Added sources of the following games: bnc, checkers, fara, FindNumbers, gomoku, reversi, rforces, sq_game, sudoku, whowtbam, xonix.
git-svn-id: svn://kolibrios.org@1805 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:48:08 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
stop:
|