Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Objects Methods Return Values

John Krueger
John Krueger
1,996 Points

Will not print

My program will compile fine but nothing prints on console. supposed to be True then False

andren
andren
28,558 Points

You will have to include the code in question in your post if you wish for us to help figure out the problem. Without seeing the code it's impossible to give any real suggestions as to what is wrong.

Also please use Code markdown when pasting your code as described below:

Code

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

     ```html
     <p>This is code!</p>
     ```

Doing so will make your code appear with proper highlighting and line breaks which makes it easier to study.

John Krueger
John Krueger
1,996 Points

Map map = new Map(8,5);

      Point point = new Point(4,2);

    '''  bool isOnMap= map.OnMap(point);
      Console.WriteLine(isOnMap);

      point = new Point(8,5);
      isOnMap = map.OnMap(point);
      Console.WriteLine(isOnMap);'''

I too have a same problem

3 Answers

Hello

doe you mean console ... note the lower case c

did you make sure to include the system namespace?

using System;

namespace TreehouseDefense
{
    class Game
    {
      public static void Main()
      {
        Map map = new Map(8, 5);

        Point point = new Point(4,2);

        bool isOnMap = map.OnMap(point);
        Console.WriteLine(isOnMap);

        point = new Point(8,5);
        isOnMap = map.OnMap(point);

        Console.WriteLine(isOnMap);
      }
    }

}

Have same problem.. :///