Results 1 to 10 of 10

Thread: Sequencing

  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Sequencing

    I was running a piece of code earlier and I kept getting a strange result being outputted. A great long string of numbers kept on being chucked out and in the end I had about 1000 until I got fed up and switched it off but not before I copied the first 6 numbers.


    Just as a matter of interest, do you know what the 131st number in the series would be?
    Jerry

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequencing

    <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">It would be the number of little lines that made up the 130th number. I'm just writing the code to find out what the actual number is...</span hide>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  3. #3
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequencing

    <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> <img src=/S/blush.gif border=0 alt=blush width=15 height=15>5.
    Why did you wait until 1000 before you stopped it?!</span hide>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sequencing

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> I laughed my head off when you said you were going to write the code. I couldn't resist it</span hide>
    Jerry

  5. #5
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequencing

    <img src=/S/scold.gif border=0 alt=scold width=50 height=15>That's mean, Mr Jezza, sir!

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>but very funny. I bet you'd love to have seen the look on my face when all those <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">5s</span hide> came up on my screen...
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sequencing

    I must admit I thought you were joking when you said <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">It would be the number of little lines that made up the 130th </span hide> because you would have got the answer if you hade looked at the seventh and the eighth number <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15>

    Anyway jolly good show on the code

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>I wasn't actually coding anything, I just got it out of the newspaper and changed the story
    Jerry

  7. #7
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequencing

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>
    Thanks, Jezza. I still can't believe I fell for it! I thought I was being really <img src=/S/clever.gif border=0 alt=clever width=15 height=15> by writing that code... I wish I could pretend I was being sarcastic when I said I'd write it, but I think the <img src=/S/catty.gif border=0 alt=catty width=19 height=18>'s out of the bag now

    Anyway, thanks for giving me a good <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>, you've made my day. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  8. #8
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sequencing

    Can you put the code in a text file and attach if possible, I would love to see what you did <img src=/S/hailpraise.gif border=0 alt=hailpraise width=27 height=22>
    Jerry

  9. #9
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequencing

    Sorry, I did it in Excel - when I saw the results I closed it in a hurry and said "no" to saving the changes.

    But to give you the general idea, I had a function to determine the number of "little lines" in a given integer, along the lines of:
    <font color=red>Function CountBlobs (a as Integer)
    Select Case a
    case 1
    countblobs = 2
    case 2, 3, 5
    countblobs = 5
    ...
    </font color=red>
    and so on. Then my main bit of code was something like
    <font color=red>
    Sub DoIt()
    Do Until ActiveCell.Row=132
    myCount=0
    For i=1 to len(ActiveCell)
    myCount=myCount + CountBlobs (Val(Mid(ActiveCell, i ,1)))
    next i

    ActiveCell.Offset(1,0)=myCount
    ActiveCell.Offset(1,0).Activate
    Loop
    End Sub
    </font color=red>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  10. #10
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sequencing

    <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    Right that's enough of the serious stuff, let's get back to silliness

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Jerry

Posting Permissions

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