I'm going to be rich! Anyone else want to help me for a cut?

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Gimme a sec, I'll post some code. Do you have something that can run VBA? Easiest would be Access. then I can just split the resultset into a table. Would probably be easier to go though any iterations.

Lemme get this straight before I write it.

You start with a string of words. Take the string, and pull the 71st word out, then the 142nd, then the 213th, and so on, and add them together as a new string?

Also, what kind of words? There are 2 deffinitions of a word. I assume you mean a "speaking" word, as in "dictionary" counting as 1 word, not the 5 character rule which would count it as 2.
 

flot

Diamond Member
Feb 24, 2000
3,197
0
0
Hmm, actually I think I've come up with a very quick way to do this.. try #2 in a few

Edit: Bah, nevermind. The time it would take to do it by hand (with a PC's help) would probably be faster than writing, unit testing, and debugging all of this.
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
Originally posted by: Evadman
Gimme a sec, I'll post some code. Do you have something that can run VBA? Easiest would be Access. then I can just split the resultset into a table. Would probably be easier to go though any iterations.

Lemme get this straight before I write it.

You start with a string of words. Take the string, and pull the 71st word out, then the 142nd, then the 213th, and so on, and add them together as a new string?

Correct.

Also, what kind of words? There are 2 deffinitions of a word. I assume you mean a "speaking" word, as in "dictionary" counting as 1 word, not the 5 character rule which would count it as 2.

Hmm, good point. Better make both. :laugh:
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Originally posted by: AyashiKaibutsu
Dude he's just trying to get you to do his cse 1001 homework.

Then he would have PM'ed me as I have no problem doing other people's homework.
 

ABitTooSpicy

Senior member
Jun 30, 2004
923
0
76
HAHA, this is great... I would do this, just to flex my coding muscles....

Anyone do this already?
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
gets fubared instantly if I hit enter too early
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
I'm sure that this is gonna get fubared when I post it, but it should work anyway. Function "CrazyMessage" will return a string split at whatever word character you specify. Easiest way to run it is to create a module in anything that takes VB and use a msgbox to display the result, expecialyw ith only 2000 input words.

Example to use:
Code:
Msgbox crazymessage("Nik is a huge dork with over eleventy billion posts on AT",3)
   'this will splt at every 3rd word and pop up a msgbox with the answer "a with billion AT"

Functions themselves: (I didn't really coment anything. Too bad)
Code:
Function CrazyMessage(ByVal Inputtext As String, ByVal NthWord As Long) As String
    Dim s() As String
    Dim OutputString As String
    'NthWord = NthWord - 1
    ReDim s(UBound(SplitWords(Inputtext)))
    s = SplitWords(Inputtext)
    For i = 1 To UBound(s)
        If Int(i / NthWord) = i / NthWord Then
            OutputString = OutputString &amp; s(i - 1) &amp; " "
        End If
    Next i
    CrazyMessage = Trim(OutputString)
End Function


Function SplitWords(ByVal Text As String, Optional ByVal Delimiter As String = " ", _
    Optional ByVal Limit As Long = -1, Optional CompareMethod As _
    VbCompareMethod = vbBinaryCompare) As Variant
    
    'bla bla, split sh!t for nik by spaces.  Accepts nearly any delimiteter.
    'not tested for mult char delims
    
    ReDim res(0 To 100) As String
    Dim resCount As Long
    Dim length As Long
    Dim startIndex As Long
    Dim endIndex As Long
    

    length = Len(Text)
    startIndex = 1
    
    Do While startIndex <= length And resCount <> Limit
        ' get the next delimiter
        endIndex = InStr(startIndex, Text, Delimiter, CompareMethod)
        If endIndex = 0 Then endIndex = length + 1
        ' make room in the array, if necessary
        If resCount > UBound(res) Then
            ReDim Preserve res(0 To resCount + 99) As String
        End If
        ' store the new element
        res(resCount) = Mid$(Text, startIndex, endIndex - startIndex)
        resCount = resCount + 1
        startIndex = endIndex + Len(Delimiter)
    Loop
    ' trim unused values
    ReDim Preserve res(resCount) As String
    ' return the array inside a Variant
    SplitWords = res()
End Function

I'll give ya something for characters in a sec.
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Here is the one for characters. Use the same way as CrazyMessage

example:
Code:
msgbox (SplitCharacters("jknhfiaskoi htsynuhocudkgsshst",3) 'returns every 3rd character
  'this would return "nik sucks"

Code:
Function SplitCharacters(ByVal InputText As String, ByVal NthChar As Long) As String
    Dim i
    Dim Res As String
    For i = 1 To Len(InputText)
        If Int(i / NthChar) = i / NthChar Then
            'match
            Res = Res &amp; Mid(InputText, i, 1)
        End If
    Next i
    SplitCharacters = Res
End Function
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
Originally posted by: Nik
Some guy buried a shiotload of gold and silver. Roughly about 30 million worth. He left an incripted message with a best friend of his and said that if no one returned for it in 10 years (after the civil war was expected to be over) that he would be mailed a decription key. The guy never got it and has since died. I have a copy of the encrypted location.
I thought the Declaration of Independence was the decryption key, or am I thinking of something else?
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Originally posted by: Nik
dude, how can I compile that? I want that proggy

It's not a program really. I could make it a DLL, but I don't have anything to compile it with (I don't have VB installed). I could toss it into Access and make ya a nice form for an interface if you want. You have MS Access? And if so, what version you want it in?
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
Originally posted by: ViRGE
Originally posted by: Nik
Some guy buried a shiotload of gold and silver. Roughly about 30 million worth. He left an incripted message with a best friend of his and said that if no one returned for it in 10 years (after the civil war was expected to be over) that he would be mailed a decription key. The guy never got it and has since died. I have a copy of the encrypted location.
I thought the Declaration of Independence was the decryption key, or am I thinking of something else?

Bingo.

It's called the Beale Papers. Google it. More info can be found here. The upcoming movie National Treasure was based on this story.
 

Tweak155

Lifer
Sep 23, 2003
11,448
262
126
they probably used a computer to create the code, who the f has that much time before they die?
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,606
166
111
www.slatebrookfarm.com
All your fancy programs..

Put it in Word or Wordperfect.
Record macro.
skip over 70 words to the 71st word. Cut. mark location, move to end, paste, move back to location
end macro.

Edit macro: add looping. Add something to end it at the proper time.

Done.


You guys are making it way too complicated.
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Originally posted by: DrPizza
You guys are making it way too complicated.
What are you talking about? it took me like 10 seconds, and I wrote a fricking front end to it.

Here, download it!
Text
 

540mb

Senior member
Jun 2, 2003
207
0
0
Come on this is a couple lines of code.....

Dim allData, newDoc, x, someArray
someArray=Split(allData, " ")
For x=0 to Ubound(someArray)
If x mod 71=0 Then
newDoc=newDoc&amp;someArray(x)&amp;" "
End If
Next

There ya go.
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Originally posted by: 540mb
Come on this is a couple lines of code.....

Dim allData, newDoc, x, someArray
someArray=Split(allData, " ")
For x=0 to Ubound(someArray)
If x mod 71=0 Then
newDoc=newDoc&amp;someArray(x)&amp;" "
End If
Next

There ya go.

That will not work, and has no modularity.
 

540mb

Senior member
Jun 2, 2003
207
0
0
Originally posted by: Evadman
Originally posted by: 540mb
Come on this is a couple lines of code.....

Dim allData, newDoc, x, someArray
someArray=Split(allData, " ")
For x=0 to Ubound(someArray)
If x mod 71=0 Then
newDoc=newDoc&amp;someArray(x)&amp;" "
End If
Next

There ya go.

That will not work.

Why not??
 

Tweak155

Lifer
Sep 23, 2003
11,448
262
126
I think the poster mis understood the numbers on the page...it isnt every 72nd word, its a word in a location of a document, so he should be able to hit 3, and have the 3rd word pasted at the bottom, hit 840, and the 840'th word should be pasted next...in that sense
 

Tweak155

Lifer
Sep 23, 2003
11,448
262
126
another thing, the value is less than a million dollars according to the document
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |