Click here to Skip to main content
16,009,343 members
Home / Discussions / C#
   

C#

 
GeneralOff topic Pin
leppie24-Aug-02 4:56
leppie24-Aug-02 4:56 
GeneralRe: Off topic Pin
Nnamdi Onyeyiri24-Aug-02 9:38
Nnamdi Onyeyiri24-Aug-02 9:38 
GeneralRe: Measure the width of a Character Pin
Paul Ingles25-Aug-02 7:14
Paul Ingles25-Aug-02 7:14 
GeneralRe: Measure the width of a Character Pin
Nnamdi Onyeyiri25-Aug-02 7:16
Nnamdi Onyeyiri25-Aug-02 7:16 
QuestionQuick way to evaluate expression in .Net? Pin
leppie24-Aug-02 3:13
leppie24-Aug-02 3:13 
AnswerRe: Quick way to evaluate expression in .Net? Pin
Domenic Denicola24-Aug-02 17:47
Domenic Denicola24-Aug-02 17:47 
AnswerRe: Quick way to evaluate expression in .Net? Pin
James T. Johnson24-Aug-02 18:47
James T. Johnson24-Aug-02 18:47 
GeneralRe: Quick way to evaluate expression in .Net? Pin
leppie24-Aug-02 23:50
leppie24-Aug-02 23:50 
Thanx James,

But again it is SLOW Frown | :( Not that slow, but about 4 times , compared to using delegates for the functions (in my case only +,-,*,/). Looks like I'm stuck with my solution, not that its bad comparing the other 2 options.

Results:
Using JScript: Time taken: 54979ms and evaluated 529293 expressions
Using delegates: Time taken: 16053ms and evaluated 529293 expressions

This basically a number(really formula) solving program. Its based on a local TV show: For those interested here are the rules.

You will be presented with 6 randomly selected numbers from the high & low groups - "high" contains one each of 100, 75, 50 and 25 and "low" contains two each of 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10.

Use some or all of the selected numbers (but do not use a number twice) and by means of basic arithmetical skills, (addition, subtraction, multiplication and division) try to reach the random total given. The quicker you complete the task, the better. In the game, you have a 30 seconds time limit. Note: Division operation must leave no remainder.

Example:
Given a target of say 345, and the numbers as 100, 25, 8, 3, 6, 2. The shortest answer will be (((100 + 25) - 8) * 3) - 6.

At first when starting this I thought this would be easy, but it did prove alot more difficult, but I got it in the end Smile | :)

Anyone wanna try it as well?

MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc
for more info. Big Grin | :-D
GeneralRe: Quick way to evaluate expression in .Net? Pin
Anonymous26-Aug-02 3:58
Anonymous26-Aug-02 3:58 
GeneralIE Toolbar Pin
Boris Yankov24-Aug-02 2:40
Boris Yankov24-Aug-02 2:40 
GeneralC# Security Problem - Please Help Pin
Rodney S. Foley23-Aug-02 19:05
Rodney S. Foley23-Aug-02 19:05 
GeneralRe: C# Security Problem - Please Help Pin
leppie24-Aug-02 2:33
leppie24-Aug-02 2:33 
GeneralRe: C# Security Problem - Please Help Pin
Rodney S. Foley24-Aug-02 12:04
Rodney S. Foley24-Aug-02 12:04 
GeneralRe: C# Security Problem - Please Help Pin
leppie24-Aug-02 12:11
leppie24-Aug-02 12:11 
GeneralRe: C# Security Problem - Please Help Pin
Rodney S. Foley24-Aug-02 12:46
Rodney S. Foley24-Aug-02 12:46 
GeneralRe: C# Security Problem - Please Help Pin
James T. Johnson24-Aug-02 12:53
James T. Johnson24-Aug-02 12:53 
GeneralRe: C# Security Problem - Please Help Pin
Eric Gunnerson (msft)26-Aug-02 11:11
Eric Gunnerson (msft)26-Aug-02 11:11 
QuestionImageFormat and EncoderParams? Pin
Steven Behnke23-Aug-02 14:58
Steven Behnke23-Aug-02 14:58 
GeneralWindows Application Design Question Pin
Chris Austin23-Aug-02 13:07
Chris Austin23-Aug-02 13:07 
GeneralRe: Windows Application Design Question Pin
David Stone23-Aug-02 13:12
sitebuilderDavid Stone23-Aug-02 13:12 
GeneralRe: Windows Application Design Question Pin
Chris Austin23-Aug-02 13:25
Chris Austin23-Aug-02 13:25 
GeneralRe: Windows Application Design Question Pin
David Stone23-Aug-02 13:34
sitebuilderDavid Stone23-Aug-02 13:34 
GeneralRe: Windows Application Design Question Pin
James T. Johnson24-Aug-02 7:47
James T. Johnson24-Aug-02 7:47 
GeneralRe: Windows Application Design Question Pin
bfarley26-Aug-02 4:20
bfarley26-Aug-02 4:20 
GeneralListBox selection Pin
manson23-Aug-02 12:30
manson23-Aug-02 12:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.