• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

BUGSH A D30-Dec-1997237 97

COPYINGH A D30-Dec-199717.6 KiB340281

MakefileH A D03-May-20222.1 KiB6531

README.for.developersH A D30-Dec-19973.2 KiB6755

README.for.usersH A D30-Dec-19971.2 KiB3424

VERSIONH A D30-Dec-199763 21

apptogui.cH A D30-Dec-19976.1 KiB241207

apptogui.hH A D30-Dec-1997607 1815

configure.hH A D03-May-2022358 2112

debug.hH A D30-Dec-1997997 4739

guiglobal.cH A D30-Dec-199782 63

guiglobal.hH A D30-Dec-1997133 106

guitoapp.cH A D30-Dec-19971.6 KiB7049

list.hH A D03-May-20221.9 KiB9787

main.cH A D30-Dec-19971.2 KiB5115

mainwindowdesign.cH A D30-Dec-199729.1 KiB523514

mainwindowdesign.fdH A D30-Dec-199755.8 KiB3,0232,851

mainwindowdesign.hH A D30-Dec-19971.1 KiB3928

mastermind.cH A D30-Dec-199721.5 KiB839685

mastermind.hH A D30-Dec-1997551 2015

mymath.cH A D03-May-20225.8 KiB212148

mymath.hH A D30-Dec-1997384 1611

types.hH A D30-Dec-1997190 117

xmastermind.lsmH A D30-Dec-1997598 1615

README.for.developers

1xmastermind by Florian Schintke <schintke@cs.tu-berlin.de>
2
3General:
4========
5
6We have a graphical application here.  To provide portability to other
7widgetsets or operating systems, we introduced an abstraction from the
8Graphical User Interface (GUI) and the rest of the application.
9
10We   have  two interfaces  (implemented  by  functions).   One for the
11application to  make output to the user,  and  another for the  GUI to
12tell   the application what  the user  has  done.  (mastermind.c calls
13functions  from apptogui.h (for  updating output) and guitoapp.c calls
14functions from mastermind.h (to tell the application what the user has
15done).
16
17Only a few source files use the functions from the used widgetset (yet
18xforms).  At the  time I  wrote this, only  two  parts (guitoapp.c and
19apptogui.c) of  the  application call  functions from  the  widgetset.
20apptogui.h provides functions to  make graphical output for the  other
21modules. So if you want to port the game  to ncurses or something else
22you only   have to reimplement  the  functions in the   guitoapp.c and
23apptogui.c.  Notice: You must  not change the apptogui.h or guitoapp.h
24file for a port.
25
26The design  of  the GUI  is  made with fdesign. fdesign  generates the
27sources mainwindowdesign.c, .h and .fd.  Nobody  changes this files by
28hand, because otherwise you can't change the design of the application
29with the tool fdesign later.
30
31It is not  easy to seperate the GUI  from the rest of the application.
32The sources mastermind.[ch]   provides  functions for the  game   like
33'user_entered_new_try',             'user_wants_new_game',          or
34'user_wants_to_see_correct_solution'.  The GUI (in mainwindowdesign.c)
35calls functions for user  events implemented in guitoapp.[ch] and this
36functions  call    functions from  mastermind.h.    Then  this service
37functions must calculate  some things, update internal data structures
38and then  call the right  routines from the  apptogui.h to provide the
39right output in the GUI.
40
41Try to  do as few  updates of  the  GUI as possible  in GUI functions.
42(example: don't calculate the  answer of a  new input  of the user  in
43guitoapp and display it).  Instead tell the mastermind.c what happened
44(by  calling  a  function   from  mastermind.h)   and  wait  for   new
45instructions from there.
46
47All callback  funtions (called if buttons  pressed down  etc.) must be
48defined  in  guitoapp.c.  No sourcecode  will  include  the headerfile
49guitoapp.h because nobody needs it. The only user of this functions is
50the automatically  generated gui and this  knows  about this functions
51already.
52
53How does the application work?
54==============================
55
56The main program initializes some stuff and  then gives the control to
57the  GUI. If a user action  occurs, the GUI calls  a function from the
58game (a function from mastermind.h).  When this function returns,  the
59GUI is waiting for  the next user action.  When  the user  presses the
60Quit button the GUI returns  to the main program  and this causes  the
61application to close.
62
63A  function  from the game  (functions  in mastermind.h), as described
64before, updates some  data structures,   makes some calculations   and
65calls some functions from the GUI  to update the  display for the user
66and returns.
67

README.for.users

1xmastermind:
2============
3
4The computer calculates a combination of five characters (each between
5A and J) and you have to try to find out  the combination the computer
6has calculated.  Your questions to  the computer are also combinations
7of five characters (each between A and J).
8
9You   get sets  of black  and/or   white  blocks as   answers  to your
10questions.
11
12If  you  get a  black block  as  answer it  means  that  there  is one
13character  in your  try at  the correct position  (but  you don't know
14which one it is).
15
16If you get a white block as answer it means that  there is a character
17in  your  guess that also   occurs  in the  solution,  but at  another
18position (but you don't know which one it  is and at which position it
19would be correct).
20
21Hint:
22=====
23
24If  you want to   change a character at a   position you can do  it in
25mainly two different ways.
26
27You can use the mouse. Therefore you have to click at the position and
28have to select a character from the choice you get.
29
30You can use the keyboard and the mouse.  Therefore you move your mouse
31over the position you want to  change and type  the character you want
32to have with the keyboard. This type of input is case insensitive.
33
34