Page 2 of 2 FirstFirst 12
Results 41 to 44 of 44

Thread: urgent: Mid() in c++

  1. #41
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    lots of ifs and stuff, I think writing it in SQ would look considerably cleaner, readable and consise
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #42
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    CB - you're right.

    But - other than for pedagogy what practical app is this?
    I've used Reynolds numbers for spiral flow, and Ulam's prime number spiral for fun (this looks like it's a relative).

    Here's a picture and discussion of a prime number spiral with a box created somewhat the way these are.

    http://hermetic.nofadz.com/pns/pns.htm

  3. #43
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Pure pedagogy. It was invented for it. I just thought it's an interesting problem.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #44
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    maybe it makes sense looking at a visual example, so i drawed this (was drawn first on paper when i tried to solve the problem)
    Attached Images Attached Images  
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width