parse error

Discussion in 'Software' started by ionmuniz, Oct 3, 2004.

  1. ionmuniz

    ionmuniz Private E-2

    I'm using apple's X code and trying to type Jesse Liberty's "Decryptix"source code into the apple IDE, and I get a parse error message.

    this is the code, and the error line is beween two **.
    The error message is

    error: parse error before `<<' token

    anyone could shed some light on this?

    TIA,

    ionmuniz


    #include <iostream>

    int main ()
    {
    std::cout << "Decryptix. (c) Copyright 1999 Liberty";
    std::cout << "Associates, Inc. Version 0.2\n" << std::endl;
    std::cout << "There are two ways to play Decryptix:";
    std::cout << "either you can guess a pattern I create, ";
    std::cout << "or I can guess your pattern.\n\n";

    std::cout << "If you are guessing, I will think of a\n";
    std::cout << "pattern of leters (e.g., abcde).\n\n";

    std::cout << "On each turn you guess the pattern and\n";
    std::cout << "I will tell you how many letters you\n";
    std::cout << "got right, and how many of the correct\n";
    std::cout << "letters were in the correct position.\n\n";

    std::cout << "The goal is to decode the puzzle as quickly\n";
    std::cout << "as possible. You control how many letters\n";
    std::cout << "can be used and how many positions\n";
    std::cout << " (e.g., 5 possible letters in 4 positions)\n";
    std::cout << "as well as wether or not might\n";
    std::cout << "contain duplicate letters (e.g., aabcd).\n\n";

    std::cout << "If I'm guessing you think of a pattern\n";
    std::cout << "and score each of my answers.\n\n";

    const int minLetters = 2,maxLetters = 10,minPositions = 3,maxPositions = 10;


    int howManyLetters = 0, howManyPositions = 0;
    bool duplicatesAllowed = false;
    int round = 1;


    while ( howManyLetters < minLetters && howManyLetters> maxLetters )


    std::cout << "How many letters? (";
    std::cout << minLetters << "-" << maxLetters <<"): ";
    std::cin >> howManyLetters;

    if ( howManyLetters < minLetters && howManyLetters> maxLetters )

    **std::cout << "please enter a number between ", << minLetters "and" << maxLetters << endl;**




    std::cout << "How many positions? (";
    std::cout << minPositions << "-" <<maxPositions << "): ";
    std::cin >> howManyPositions;

    char choice;
    std::cout<<"Allow duplicates (y/n)? ";
    std::cin >> choice;
    return 0;
    }
     
  2. ionmuniz

    ionmuniz Private E-2

    Never Mind!

    I got the bug! After a lot or trial and error I found out the the : (do you call it colon in English?) was messin the code.

    On the other side I got myself into another mess, the doggone loop ain't stopin', but that seems easier to handle.

    Ion
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds