My first app on Android Market -- 24-Game

Dears, let me introduce my amazing Android game to you all:

It's - <<<< 24-Game >>>>

A mathematical card game in which the object is to find a way to manipulate four integers so that the end result is 24.

And in this Android version, we play Single Game, Multi-player Game, and some else.

Features:

1. I get very very interesting Quest Repository, and in every level, the Repository define special symbols can be used,
which means: you can't figure it out without these symbols, and, there must be at least one solution for each quest.
THE REPOSITORY IS THE SOUL OF THIS GAME.

2. Thought we got the repository, but I haven't define each solution in app, cos the ANDROID will calculate each for you.
And it's really fast, because.. Im a fan of 24-Game, had optimize my arithmetic for almost 3 years, it's absolutely not simple exhaustion.

3. Powerful Calculator: you define the quest, the symbols, the target the ANDROID tell you the answer.

4. Multi-Player: em.. It's not internet play, that's I set for multi-players(max 4) play on a single android device(G1/G2), enjoy.
And I plan to implement play on internet and through blue tooth.

5. Kinds of symbols: more then add, sub, div, mul, try to find out more in Game. And I leave a easy to extend Interface in it,
so if you have some idea of symbol, please kindly mail me know it.

6. A calculator-like input form, easy to use and had tips.

7. Support for English, Simplified Chinese, Traditional Chinese, and maybe more in future.


At last, this game is the second android app of mine ( the first still in alpha), I love android, and I wish you love my game and
post on market about it. Thanks.

The game is free, below is the download url, but recommend you to download from Market for update (app name: 24-Game).

screenshot:


more screenshot:
http://picasaweb.google.com/yinguowei/24
阅读更多
换一批

This is my My first math programm....??

06-26

//---------------------------------------------------------------------------rnrn#include rn#pragma hdrstoprn#include "math.h"rn#include "MathSys.h"rn#include "stdio.h"rn#include "vcl/inifiles.hpp" //-------------------------------INIfile Is OK!rn//---------------------------------------------------------------------------rn#pragma package(smart_init)rn#pragma resource "*.dfm"rnTForm1 *Form1;rnint pt=1;rn//---------------------------------------------------------------------------rn__fastcall TForm1::TForm1(TComponent* Owner)rn : TForm(Owner)rnrnrn//---------------------------------------------------------------------------rnvoid __fastcall TForm1::FormCreate(TObject *Sender)rnrn OnWrite0(N,N);rn HangLieShi=1;rnrn//---------------------------------------------------------------------------rnvoid TForm1::OnWrite0(int i,int j)rnrn String S;rn for(int i0=1;i0<=i;i0++)rn S.sprintf("%d",i0);StringGrid1->Cells[0][i0]=S;rn for(int i0=1;i0<=j;i0++)rn S.sprintf("%d",i0);StringGrid1->Cells[i0][0]=S;rnrnrnrnvoid __fastcall TForm1::Edit2KeyDown(TObject *Sender, WORD &Key,rn TShiftState Shift)rnrn if(Key==13)rn rn if(Edit1->Text!=""&&Edit2->Text!="")rn rn if(StrToInt(Edit1->Text)<1||StrToInt(Edit2->Text)<1||StrToInt(Edit1->Text)>40||StrToInt(Edit2->Text)>40)rn MessageBox(Handle,"Please Check The Number(1~40)","Note!",0);return ; rnrn h=StrToInt(Edit1->Text);l=StrToInt(Edit2->Text);rnrn StringGrid1->ColCount=l+1;rn StringGrid1->RowCount=h+1;rn OnWrite0(h+1,l+1);rn rn else MessageBox(Handle,"Please Input the ColNumber or LieNumber","Please!",0);rn rnrn//---------------------------------------------------------------------------rnrnvoid __fastcall TForm1::Edit1KeyDown(TObject *Sender, WORD &Key,rn TShiftState Shift)rnrnrn if(Key==13)rn rn if(Edit1->Text!=""&&Edit2->Text!="")rn rn if(StrToInt(Edit1->Text)<1||StrToInt(Edit2->Text)<1||StrToInt(Edit1->Text)>40||StrToInt(Edit2->Text)>40)rn MessageBox(Handle,"Please Check The Number(1~40)","Note!",0);return ; rnrn h=StrToInt(Edit1->Text);l=StrToInt(Edit2->Text);rnrn StringGrid1->ColCount=l+1;rn StringGrid1->RowCount=h+1;rn OnWrite0(h+1,l+1);rn rn else MessageBox(Handle,"Please Input the ColNumber or LieNumber","Please!",0);rn rnrnrn//---------------------------------------------------------------------------rnbool TForm1::OnRead0(int p)rnrnif(p==1)rnrn for(int i=0;iCells[j+1][i+1]!="") A[i][j]=StrToFloat(StringGrid1->Cells[j+1][i+1]);rn else return false;rn rn return true;rnrnelsernreturn true;rnrnrnrnvoid __fastcall TForm1::DieDai1Click(TObject *Sender)rnrn if(PanDuan1(1))rn rn if(OnRead0(1))rn float Sovle[N][3*N];rn float D;rn MessageBox(Handle,"Please Confirm 严格主对角占优!","OK",0);rn AnsiString S;rn if(InputQuery("Input The Start point","The Start Point:",S))rn for(int i=0;iD&&p<3*N-1);rnrn StringGrid1->ColCount=l+2;rn StringGrid1->RowCount=h+3;rn for(int i=0;iCells[i+1][h+2]=FloatToStr(Sovle[i][p]);rnrn rn if(p!=3*N-1)rn StringGrid1->Cells[l+1][h+2]=IntToStr(p);rn else StringGrid1->Cells[l+1][h+2]="No Sovle";rnrn rn rn rn else MessageBox(Handle,"Please Finish The Data!","Check",0);return;rn rn else MessageBox(Handle,"No SOVEL or No Def HANG and LIE!","Check",0);rnrn//---------------------------------------------------------------------------rnbool TForm1::PanDuan1(int i)rn if(i==1)rn return h==l-1?true:false;rn if(i==2)rn return h==l?true:false;rn return true;rnrnfloat TForm1::MAX0(float Z[N][3*N],int q)rnrn float crease=fabs(Z[0][q]-Z[0][q-1]);rn for(int i0=0;i0=i;j--)rn if(A[i][i]!=0) A[q][j]=A[q][j]-A[i][j]/A[i][i]*A[ q][i];rn else TiaoZhen(i+1);return;rnrnrn rn if(Check(h)==0)rn rn for(int i=h-1;i>=0;i--)rn rn for(int q=i-1;q>=0;q--)rn for(int j=h+l-1;j>=i;j--)rn if(A[i][i]!=0) A[q][j]=A[q][j]-A[i][j]/A[i][i]*A[ q][i];rn else TiaoZhen(i+1);return;rn rnrn for(int i=0;iColCount=l+1+h;rn StringGrid1->RowCount=h+2+h;rn for(int i=0;iCells[j+1][i+h+2]=FloatToStr(A[i][j]);rn rn else MessageBox(Handle,"No Sovler","Notes",0);HangLieShi=0;return;rn rn else TiaoZhen(Check(h));return;rn rn else MessageBox(Handle,"Please Finish The Data!","Check",0);return;rn rn else MessageBox(Handle,"No SOVEL or No Def HANG and LIE!","Check",0);rnrnrnrn//---------------------------------------------------------------------------rnrnvoid __fastcall TForm1::Reflash1Click(TObject *Sender)rnrn Edit1->Text="";rn Edit2->Text="";rn StringGrid1->ColCount=N+1;rn StringGrid1->RowCount=N+1;rn for(int i=0;iCells[j][i]="";rnrn pt=1;rn OnWrite0(N,N);rn StringGrid1->Refresh();rnrn//---------------------------------------------------------------------------rnint TForm1::Check(int t)rnrn for(int i=0;iCells[i][1];StringGrid1->Cells[i][1]=StringGrid1->Cells[i][pp];rn StringGrid1->Cells[i][pp]=S;rn elsern for(int i=1;i<=l;i++)rn S=StringGrid1->Cells[i][pp];StringGrid1->Cells[i][pp]=StringGrid1->Cells[i][h];rn StringGrid1->Cells[i][h]=S;rn XiaoQu1Click(this);rnrnvoid __fastcall TForm1::NiZhen1Click(TObject *Sender)rnrnrn MessageBox(Handle,"Please Read the Qquention!","Check",0);return;rnrnrnrn//---------------------------------------------------------------------------rnvoid TForm1::Refresh()rnrn for(int i=0;iFilter="TXT Files(*.TXT)|*.txt";rn if(SaveDialog1->Execute())rn rn FILE *fp;rn float temp;rn fp=fopen((SaveDialog1->FileName+".TXT").c_str(),"w");rn if(h==0&&l==0)MessageBox(Handle,"The file is ampty!","Warnin" ,1);fclose(fp);return;rn fprintf(fp,"%d\n",h);rn fprintf(fp,"%d\n",l);rn for(int i=0;iCells[j+1][i+1]);if(j!=l-1) fprintf(fp,"%f ",temp);else fprintf(fp,"%f\n",temp);rn fclose(fp);rn rnrn//---------------------------------------------------------------------------rnrnvoid __fastcall TForm1::Open1Click(TObject *Sender)rnrn OpenDialog1->Filter="TXT Files(*.TXT)|*.txt";rn if(OpenDialog1->Execute())rn rn FILE *fp;rn float ftmp;rn int itmp1,itmp2,i,j;rn fp=fopen(OpenDialog1->FileName.c_str(),"r");rn if(!fscanf(fp,"%d",&itmp1)||(!fscanf(fp,"%d",&itmp2))) MessageBox(Handle,"The data File is read error!","Warning",1);fclose(fp);return;rn h=itmp1;rn l=itmp2;rn Edit1->Text=IntToStr(itmp1);rn Edit2->Text=IntToStr(itmp2);rnrn StringGrid1->ColCount=itmp2+1;rn StringGrid1->RowCount=itmp1+1;rn OnWrite0(itmp1,itmp2);rn for(i=0;iCells[j+1][i+1]=FloatToStr(ftmp);rn else MessageBox(Handle,"The data is not Complete!","Waring!",1);fclose(fp);return;rn rnrn fclose(fp);rn rnrn//---------------------------------------------------------------------------rnrnvoid __fastcall TForm1::StuZongHeAnysys1Click(TObject *Sender)rnrn //Refresh();rn if(OnRead0(pt))rn AnsiString S="5";rn int Head_del,Last_del;rn // float temp[N][N];rn PaiXu(h,l,true);rn if(InputQuery("Input the Head_DEL Number","The Head_DEL Number(5)",S))rn Head_del=StrToInt(S);rn else Head_del=5;rn if(InputQuery("Input the Last_DEL Number","The Last_DEL Number(5)",S))rn Last_del=StrToInt(S);rn else Last_del=5;rn for(int i=0;iCells[j+1][i+1]=FloatToStr(tmp[i][j]);rn StringGrid1->RowCount=h+3;rn for(int t=1;t<=l;t++)rn StringGrid1->Cells[t][h+2]=FloatToStr(Stu_Aver(t-1,Head_del,Last_del,true));rnrn pt++;rn rn else MessageBox(Handle,"Please Complete the data or the data is not match!","Warning!" ,1);return;rnrnrn//---------------------------------------------------------------------------rnvoid TForm1::PaiXu(int i,int j,bool mode)rnrnrn float Temp,p;rn Swap();rn if(mode)rn rn for(int j0=0;j0Cells[j+1][i+1]=FloatToStr(tmp[i][j]);rn StringGrid1->ColCount=l+3;rn for(int t=1;t<=h;t++)rn StringGrid1->Cells[l+2][t]=FloatToStr(Stu_Aver(t-1,Head_del,Last_del,false));rnrn pt++;rn rn else MessageBox(Handle,"Please Complete the data or the data is not match!","Warning!" ,1);return;rnrnrnrn//---------------------------------------------------------------------------rnvoid TForm1::Swap()rnrnrn for(int i=0;iFilter="INI Files(*.INI)|*.ini";rn if(SaveDialog1->Execute())rn rnrn TIniFile *IniSave=new TIniFile(SaveDialog1->FileName+".ini");rn IniSave->WriteString("Col_Row","Row",IntToStr(h));rn IniSave->WriteString("Col_Row","Col",IntToStr(l));rn for(int i=0;iWriteString("DATA","A["+IntToStr(i)+","+IntToStr(j)+"]",StringGrid1->Cells[j+1][i+1]);rn delete IniSave;rn rnrnrn//---------------------------------------------------------------------------rnrnvoid __fastcall TForm1::Openini1Click(TObject *Sender)rnrn OpenDialog1->Filter="INI Files(*.INI)|*.ini";rn if(OpenDialog1->Execute())rn rn TIniFile *IniOpen=new TIniFile(OpenDialog1->FileName);rn h=StrToInt(IniOpen->ReadString("Col_Row","Row","0"));rn l=StrToInt(IniOpen->ReadString("Col_Row","Col","0"));rn Edit1->Text=IniOpen->ReadString("Col_Row","Row","0");rn Edit2->Text=IniOpen->ReadString("Col_Row","Col","0");rn StringGrid1->RowCount=h+1;rn StringGrid1->ColCount=l+1;rn OnWrite0(h,l);rn for(int i=0;iCells[j+1][i+1]=IniOpen->ReadString("DATA","A["+IntToStr(i)+","+IntToStr(j)+"]","0");rn delete IniOpen;rn rnrnrn//---------------------------------------------------------------------------rnrnBut there are some mistakes!Please give me some advices!thinks!

没有更多推荐了,返回首页