2.75

2.8 | 4 ratings Rate this file 7 Downloads (last 30 days) File Size: 2.58 KB File ID: #12125

GUESS NUMBER

by Krishna Lalith

 

31 Aug 2006 (Updated 01 Sep 2006)

CPU will identify the number in your mind given some clues.

| Watch this File

File Information
Description

1. THINK OF A NUMBER BETWEEN 1 TO 63.
2. CPU SHOWS SOME TABLES WHERE U NEED TO TELL WHEATHER UR NUMBER IS THERE OR NOT.
3. FINALLY CPU IDENTIFIES UR NUMBER.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
cpu, games, guess, numbers, tables
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
03 Feb 2008 michael sommmerfield

i like it like a lot

i have to send to all my friends

22 Sep 2006 Prasanna Ganesan

Agree with D'Errico comments. But well thought algorithm.

04 Sep 2006 Diary Off  
01 Sep 2006 John D'Errico

A cute variation on bisective search.

First, some minor flaws that can be repaired by better programming practice:

- When the computer finally guesses your result, it leaves you hanging, with no button for a new game. You must close the figure and restart it yourself.

- If you close the window before the computer is done, an error results.

- Since you are always presented with EXACTLY 32 numbers in the sample, why are there always 36 slots provided, with 4 of the numbers as zero?

- Why is the mouse pointer set to crosshairs? (Silly answer: becuase this code uses ginput, for no valid reason.) There is no need to use ginput, just to get button clicks.

A more serious flaw is this code is a script, that starts out by CLEARING your matlab workspace, then leaves behind a lot of trash in the variables it has used. This is just poor programming practice. It alone is usually enough for me to give a code a poor(1) rating. I wanted to rate this code as a Good(4) before I noticed that all of my work had been deleted.

Contact us