LaughingBelly's Profile User Rating: -----

Reputation: 47 Craftsman
Active Members
Active Posts:
104 (0.06 per day)
11-April 11
Profile Views:
Last Active:
User is offline Mar 20 2015 07:24 AM

Previous Fields

Dream Kudos:
Icon   LaughingBelly has not set their status

Posts I've Made

  1. In Topic: Clear 'white' space on random tile map

    Posted 14 Mar 2015

    An image of what you expect the output to look like might help.

    Assuming you want to keep the outside boundary straight, you could walk through each brown line from one end to find all lines that do not have a wall in them. If you find such line, fill it with walls. If you want to keep a hallway around each entire room, you would have to look ahead one more line before deciding to fill that line.
  2. In Topic: Simple Game with Computer Turns

    Posted 2 May 2014

    You really need to understand timers better than you do currently. look through THIS and follow the example at the end.

    For any kind of GUI programming, it is very important to think in an event driven fashion. All code will be executed only in response to some event.

    Lets say you define a generic function to perform a dice roll PerformRoll. It will be called with the player information on the turn of the player.

    here are the events and actions that will happen with this approach:

    1) Game starts - we are just waiting for some event as it is player's turn
    2) Player clicks on Roll button - button click handler gets called for roll button
    Inside button click handler, you will call PerformRoll(playerNumber)
    Once PerformRoll returns, you will setup a timer for computer's turn and return. NOTE that you do not call PerformRoll for computer from here.
    3) Timer generates Timer elapsed event after the set interval - calls the timer elapsed event handler (similar to button click handler)
    Inside this handler, you will disable timer and call PerformRoll(playerNumber)
    Once PerformRoll returns, you will just return
    4) Player clicks on Roll button -... and so on

    Note that each turn will be handled as a separate event. Currently your code combined steps 2 and 3 into one step while also using timer incorrectly.

    Edit: I second tlhIn`toq's suggestion. I was about to say move away from WinForms as well. Investing time in understanding WPF and Task Parallel libraries will improve the quality of your GUIs tremendously.
  3. In Topic: Segmentation Fault 11 --- C

    Posted 20 Feb 2014

    Using this line does not do what you think it does.
    char *a[8]={"XXXXX,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"}; 
    This sets the first element in the array to "XXXXX,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday". rest of the array is just random junk.

    What you probably meant was this
    char *a[8]={"XXXXX","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};

    Note that each "" pair represents one string. If you want to initialize an array of 8 strings, you have to supply 8 strings.

My Information

Member Title:
D.I.C Head
Age Unknown
Birthday Unknown

Contact Information




LaughingBelly has no profile comments yet. Why not say hello?