Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

NaturalLanguageMultiply extends Say ?

 
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
am i the only one that has tried this? ever since i wrote NaturalLanguageMultiply i have been wondering how easy it would be to make it extend my Say (4b) class so i could have the output in "natural language" as well...
it just so happens that the first method in my Say class takes a String as an argument... so, i made my NatualLanguageMultiply extend Say and then i just called the method with my multiplied value (converted to a String)!
anyway, i am just wondering if i am the only person who has tried this... (i hope not, that would mean i am obsessed )
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I'm concerned you are obsessed
To be honest though my son did suggest that I let NaturalLanguageMultiply say its result but I was just to damm lazy.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
haha... so i am thinking like your son. i don't know what to say to that.
actually, this could be a good introductory program for the OO school...
 
whippersnapper
Posts: 1843
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A fun thing to write would be the "if this is tea, bring me coffee; if this is coffee, bring me tea" version.
For example, pass in "17" and get "seventeen" as the result. Pass in "seventeen" and get "17" as the result.
If you're writing this as some number conversion library class, I'm sure you'd want different methods based on which direction you're converting. But if you're doing it as an exercise, it might be fun to let the program figure out whether the input is text or a figure.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
great, i thought i was going to stay away from programming this weekend... now i have to write this! thanks, michael.
 
Michael Matola
whippersnapper
Posts: 1843
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In case you're looking for other things to work on...
Nobody's posted a response to my "challenge" regarding adding new validation functionality to the assignment log automation prototype.
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are obsessed . But, what a way of looking at the assignment.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
michael, i have an idea for the color part... i modified a bulletin board servlet a couple weeks ago so the font changes based on the username. it would be really easy to implement that based on the days since last submission. making it change the background vs. the text font is a no brainer.
[This message has been edited by Greg Harris (edited August 15, 2001).]
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Michael Matola:
In case you're looking for other things to work on...
Nobody's posted a response to my "challenge" regarding adding new validation functionality to the assignment log automation prototype.



 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic