Sponsored Content
Full Discussion: C++ Help
Top Forums Programming C++ Help Post 302274800 by Corona688 on Thursday 8th of January 2009 11:39:03 AM
Old 01-08-2009
Code:
board.cpp: In function ‘int main()':
board.cpp:66: error: ‘gameover' was not declared in this scope

That means that gameover wasn't declared. Looking back, I see you called it 'game', not 'gameover', and made it an int, not a bool, so the compiler gives up when it can't find the variable gameover anywhere. Fine, change the top of the while loop into while(game == 1)

Code:
board.cpp: At global scope:
board.cpp:95: error: expected constructor, destructor, or type conversion before ‘<<' token
board.cpp:97: error: expected declaration before ‘}' token

{ }'s always come in pairs surrounding one or more lines of code, if the compiler finds a } without a { it will stop with an error like it did on line 97. You have lots and lots of extra }'s, which also indirectly causes the error on line 95 -- the compiler thinks main()'s code block has already closed at this point, and won't let you call cout outside of a function. Remove these lines:
Code:
}

cout <<endl;

}

k++;

if( k ==42){

game =0;

}

}

Also, take a close look at where you have these lines:
Code:
k++;

if( k ==42){

game =0;

}

This is outside the loop I gave you, and would never have ran until the game already ended, which I don't think is what you want. Look for where I say you need to check for game over.
Quote:
Is there bits i need to change because i don't really understand it
What would you like explained? I wrote it as clearly as I know how.
 
HOOLA(6)							     board_gen								  HOOLA(6)

NAME
make-gnome-freecell-board, make-aisleriot-freecell-board, make-microsoft-freecell-board, make-pysol-freecell-board - Programs to generate boards to be used as input to Freecell Solver. SYNOPSIS
program [-t] board-number or for make-pysol-freecell-board: program [-t] [-F] board-number [game-string] or for make-aisleriot-freecell-board: program [-t] board-number [game-string] DESCRIPTION
These programs are command-line programs that can generate the initial board of the Freecell games of several popular Solitaire implementations. Those boards can be in turn be inputted to fc-solve by means of a pipeline, or placed inside a file for safe-keeping. make-pysol-freecell-board and make-aisleriot-freecell-board also accept an optional third argument which indicates the game type. This type defaults to Freecell, but is useful for generating the boards of other games. Note that using this flag does not preclude one from using the "--game" flag of fc-solve. make_pysol_freecell_board.py accepts another parameter called -F or --pysolfc that deals the PySolFC boards instead of the classic PySol ones. A common paradigm for using those programs is something like: bash:~$ make-microsoft-freecell-board 11982 | fc-solve -l gi If the "-t" option is specified, then the 10 cards are printed with "T"'s, instead of "10"'s. While this does not have any effect on fc- solve it may prove useful for other solvers or solitaire implementations which do not accept "10"'s. Here is a short description of each program: make-gnome-freecell-board Generate the boards of the standalone Freecell program that comes with the GNOME desktop. make-aisleriot-freecell-board Generate the Freecell boards of GNOME's AisleRiot. make-pysol-freecell-board A Python script that generates the boards of the various games of PySol. make-microsoft-freecell-board A program that generates the boards of Microsoft Freecell and of the Freecell Pro implementation of Freecell. OPTIONS
board-number is the board number as a decimal number. game-string is a string describing the game. Valid strings and their respective games are: bakers_game - Baker's Game (*) bakers_dozen - Baker's Dozen (Broken) (*) beleaguered_castle - Beleaguered Castle (*) citadel - Citadel cruel - Cruel der_katz - Der Katzenschwantz die_schlange - Die Schlange eight_off - Eight Off (*) fan - Fan forecell - Forecell freecell - Freecell (the default) good_measure - Good Measure ko_bakers_game - Kings' Only Baker's Game relaxed_freecell - Relaxed Freecell relaxed_seahaven - Relaxed Seahaven Towers seahaven - Seahaven Towers (*) simple_simon - Simple Simon (*) streets_and_alleys - Streets and Alleys make-aisleriot-freecell-board supports only the games marked with an asterisk (*). SEE ALSO
fc-solve (6) /usr/share/doc/freecell-solver-bin/README.board_gen AUTHOR
Shlomi Fish, <http://www.shlomifish.org/> . board_gen 3.12.0 2012-06-22 HOOLA(6)
All times are GMT -4. The time now is 04:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy