Jump to content



Photo
- - - - -

Maze 3d


  • Please log in to reply
8 replies to this topic

#1 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 05 November 2006 - 03:30 PM

Download here.

I used a methol to generate random maze but there is a problem with rand() so it can generate only 1 maze :( ! Help!

Use 2,4,6,8 or cursor key to move. You must try to find some where look like Posted Image to win.

Screen shot:

Posted Image


Have fun.

#2 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 05 November 2006 - 11:31 PM

You should initialize the random numbers generator with a number which should be different each time you run the Add-In. I'm sure you will easily find how to do that :rolleyes:

#3 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 05 November 2006 - 11:44 PM

Ok, call RandSeed() before use rand(). Thanks.

#4 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 06 November 2006 - 01:25 AM

No... How to initialize it??? Orwell, are you talking about gbr_read_byte(IO_RANDMEM))?

#5 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 06 November 2006 - 03:00 AM

:roflol: So easy... :roflol:

Download v1.1 here B) . This ver added map viewer ([clear] key). You can play new maze by press back key.

Enjoy.

Btw, I dont think the wall texure and the win texture are beautiful, please send me a 32x32 bitmap for them.

#6 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 06 November 2006 - 12:37 PM

B) Ver 1.2 was out, try it ;) . Screen shots:

Posted Image

To win you must find Posted Image. Give me your opinions...

#7 Behnoud

Behnoud

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 338 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    CP 300+ OS2.2/
    FX 3600 pv/
    FX 115 s/
    FX 602P

Posted 06 November 2006 - 05:28 PM

Everyday innovation by VANHOA!
Keep on developing on your ADDs.

#8 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 681 posts
  • Gender:Male
  • Location:Somewhere in Europe.
  • Interests:Computer Algebra, Numerical Analysis.

  • Calculators:
    ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 06 November 2006 - 11:17 PM

No... How to initialize it??? Orwell, are you talking about gbr_read_byte(IO_RANDMEM))?

A simple and efficient way to set a random seed is by using the internal clock. I'm not a C/C++ expert, but Orwell is probably talking about something like this:
#include <ctime>

...

srand(time(NULL))

...

< call rand() as needed >


#9 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 06 November 2006 - 11:27 PM

First I use obc to generate a real random number then I use it to initialize the rand() function...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users