Help with a file?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

A very kind soul did up an XL2K sheet which is incredibly fabulous. It was
a gift to our group and so I feel I can't go back and ask for more in terms
of what it will generate. This file is really kewl. You enter a quotation,
etc., into the box and it generates a word puzzle called a Quotefall.

The difficulty lies in the solution grid since one has to do it manually and
that is surprisingly time-consuming. Last night, it actually took me 25
minutes to get the letters placed just so because after each time I'd be
part-way through typing in the individual letters for the solution, I'd see
that the placement of the original quotation needed adjusting so would have
to fix the quote and re-generate the puzzle which would mean having to start
all over re-typing in the solution.

Since it so easily generates the puzzle was hoping someone would know how to
fix this file so that a solution grid could also be generated.

I know it is a lot to ask but I know my limitations and this is too far
advanced for me. So I thought I'd ask.

I'm in the process of setting up a website for free Stargate word puzzles
and Quotefalls will be one type that I'll create.

So if anyone is interested in this small challenge, pls go here for the
Excel file.

http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls.html



The direct links are these --
The XLT file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/QuotefallsGenerator.xlt

Puzzle in 10k GIF format:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01_p.gif

Solution I did up manually in another 10k GIF file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01a.gif
This is what I hope can be added to the coding (on another button maybe?) so
that it generates the same puzzle but filled in. In other words, so that it
dumps the same quotation in the boxes that the original puzzle show. Hope
that's clear (?).

Thanks so much in advance for anyone's help. I know it's an imposition but
I don't know anyone who can do this. And I thought someone might get a kick
out of doing this <g>.

I'll give full credit at all times to those who helped and who'd like me to
do so. Cheers. :blush:D
 
S

StargateFan

A very kind soul did up an XL2K sheet which is incredibly fabulous.
It was a gift to our group and so I feel I can't go back and ask for
more in terms of what it will generate. This file is really kewl.
You enter a quotation, etc., into the box and it generates a word
puzzle called a Quotefall.

The difficulty lies in the solution grid since one has to do it
manually and that is surprisingly time-consuming. Last night, it
actually took me 25 minutes to get the letters placed just so because
after each time I'd be part-way through typing in the individual
letters for the solution, I'd see that the placement of the original
quotation needed adjusting so would have to fix the quote and
re-generate the puzzle which would mean having to start all over
re-typing in the solution.

Since it so easily generates the puzzle was hoping someone would know
how to fix this file so that a solution grid could also be generated.

I know it is a lot to ask but I know my limitations and this is too
far advanced for me. So I thought I'd ask.

I'm in the process of setting up a website for free Stargate word
puzzles and Quotefalls will be one type that I'll create.

So if anyone is interested in this small challenge, pls go here for
the Excel file.

http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls.html

The direct links are these --
The XLT file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/QuotefallsGenerator.xlt

Puzzle in 10k GIF format:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01_p.gif

Solution I did up manually in another 10k GIF file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01a.gif
This is what I hope can be added to the coding (on another button
maybe?) so that it generates the same puzzle but filled in. In other
words, so that it dumps the same quotation in the boxes that the
original puzzle show. Hope that's clear (?).

Thanks so much in advance for anyone's help. I know it's an
imposition but I don't know anyone who can do this. And I thought
someone might get a kick out of doing this <g>.

I'll give full credit at all times to those who helped and who'd like
me to do so. Cheers. :blush:D
 
S

StargateFanFromWork

So, basically you want a "cheat" routine that fills in the puzzle ?

Yes, that's it! That way, the solution would be easy to generate, too.
See, I can't tell easily if the puzzle follows the right rules until I've
typed the solution letters in. So like what happened the other day, it took
me about 9 tries before the finished puzzle was right and that took about 25
mins which would take only a minute or two with the vb coding. Here's the
type of thing that happens:

- there must be a black box between words, so sometimes one inadvertently
has one word on one line to the end, and the next word begins on the next
line with no space. The puzzler doesn't know there are actually two words
without that black box. I miss the odd one until I actually type up the
solution manually each time.

- or, after generating and then typing in solution I see that I should shift
the words around for a better jumble of letters.

- I've put in extra spaces between words sometimes, which again I don't
seem to catch till typing up the solution and then have to re-generate the
puzzle again.

All the above plus the time it actually takes to type in the letters mean
that it takes a heck of lot longer than desired to actually create a puzzle
<g>.

.............................................................................
.......................................
However, there is one thing I'm not sure of -- is the that is puzzle
generated each time the same if the text isn't changed? I'd have to test
that. So what occurred to me today to worry about is if it's wise to
generate a puzzle then to generate a solution since they might not
correspond. Perhaps something simpler, though manual would be better (and
would be easier to code):

To modify this quotefalls generator's code to at the same time dump the
correct letters down into right boxes rather than leaving the boxes blank.
So it would jumble up the letters at the top as per normal, but would put
the solution down below at the same time. Then I'd save the entire thing
like this as the solution and then could delete the solution letters and
save that to bitmap and that would be the puzzle. _That_ deletion code is
something I believe I could do because I'd just record the keystrokes. So
that part is okay <g>.

Anyway, though the rest of the vb in this file that would need modifying is
way beyond my limited abilities, I hope that - it seems that in theory at
least - it might not be too difficult (?). Well, here's hoping that it's
something someone wouldn't mind playing with. <g>

Thanks. :blush:D
 
S

StargateFan

A very kind soul did up an XL2K sheet which is incredibly fabulous.
It was a gift to our group and so I feel I can't go back and ask for
more in terms of what it will generate. This file is really kewl.
You enter a quotation, etc., into the box and it generates a word
puzzle called a Quotefall.

The difficulty lies in the solution grid since one has to do it
manually and that is surprisingly time-consuming. Last night, it
actually took me 25 minutes to get the letters placed just so because
after each time I'd be part-way through typing in the individual
letters for the solution, I'd see that the placement of the original
quotation needed adjusting so would have to fix the quote and
re-generate the puzzle which would mean having to start all over
re-typing in the solution.

Since it so easily generates the puzzle was hoping someone would know
how to fix this file so that a solution grid could also be generated.

I know it is a lot to ask but I know my limitations and this is too
far advanced for me. So I thought I'd ask.

I'm in the process of setting up a website for free Stargate word
puzzles and Quotefalls will be one type that I'll create.

So if anyone is interested in this small challenge, pls go here for
the Excel file.

http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls.html

The direct links are these --
The XLT file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/QuotefallsGenerator.xlt

Puzzle in 10k GIF format:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01_p.gif

Solution I did up manually in another 10k GIF file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01a.gif
This is what I hope can be added to the coding (on another button
maybe?) so that it generates the same puzzle but filled in. In other
words, so that it dumps the same quotation in the boxes that the
original puzzle show. Hope that's clear (?).

Thanks so much in advance for anyone's help. I know it's an
imposition but I don't know anyone who can do this. And I thought
someone might get a kick out of doing this <g>.

I'll give full credit at all times to those who helped and who'd like
me to do so. Cheers. :blush:D
 
S

StargateFan

On Sun, 11 Mar 2007 07:17:10 -0500, StargateFan

[snip]
So if anyone is interested in this small challenge, pls go here for
the Excel file.

http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls.html

The direct links are these --
The XLT file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/QuotefallsGenerator.xlt

Puzzle in 10k GIF format:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01_p.gif

Solution I did up manually in another 10k GIF file:
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Stargate_01a.gif
This is what I hope can be added to the coding (on another button
maybe?) so that it generates the same puzzle but filled in. In other
words, so that it dumps the same quotation in the boxes that the
original puzzle show. Hope that's clear (?).

Thanks so much in advance for anyone's help. I know it's an
imposition but I don't know anyone who can do this. And I thought
someone might get a kick out of doing this <g>.

I'll give full credit at all times to those who helped and who'd like
me to do so. Cheers. :blush:D

I don't know what else to say. I'm hoping that someone can help with
this so trying to figure out how to make this easier. I don't know
what else to do, but going to give it a try. The scripting is beyond
me. I can't get anything to work. But the process I know will be
simple for anyone in this group as you all know so much.

I've uploaded another example. Here is what the current page's
scripts are generating (an example):
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Puzzle__p.gif

This is what is actually needed, as it's easier to generate the
solution then just erase the solution part itself to create the puzzle
(sort of like working backwards <g>):
http://www.angelfire.com/art2/hypatia/1Other/Puzzles/Quotefalls_Puzzle_a.gif

This is the code that generates just the puzzle part. What's needed
is that the text be dumped below the scrambled letters part to form
the "solution" part:
****************************************************************************************************************
'Quotefalls Generator (r.e.s. 2007/2/6)

Sub Quotefalls()
Dim A(100, 100) 'array for ascii codes of quote letters (unsorted)
Dim B(100, 100) 'array for sorted quote letters
Dim x(100) 'array for column
Dim s, t, u 'strings
Dim ascii 'ascii code of a letter
Dim i, j, k, imax, jmax

'get the input quotation from the workbook
s = Worksheets("Sheet1").Range("B2:B2")

'initialise A and B
For i = 1 To 100
For j = 1 To 100
A(i, j) = Asc(" ") 'ascii code for space
B(i, j) = " " 'space
Next
Next

'create array A from the quote
i = 1
j = 1
jmax = 1
For k = 1 To Len(s)
ascii = Asc(Mid(s, k, 1))
If (ascii <> 10) Then
If j > jmax Then
jmax = j
End If
A(i, j) = ascii
j = j + 1
Else
j = 1
i = i + 1
End If
Next

imax = i 'imax = number of rows of text ascii in A
'jmax = number of columns

'create sorted array B (the "quotefalls")
For j = 1 To jmax
For i = 1 To imax
ascii = A(i, j)
If ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And ascii
<= 122)) Then
x(i) = ascii
Else
x(i) = Asc(" ")
End If
Next
QSort x, 1, imax
ii = 0
For i = 1 To imax
If x(i) <> Asc(" ") Then
ii = ii + 1
B(ii, j) = Chr(x(i))
End If
Next
Next

Worksheets("Sheet1").Range("4:20").Clear
'write the column-sorted quotation
For i = 1 To imax
For j = 1 To jmax
Worksheets("Sheet1").Range("B4:DZ30").Cells(i, j).Select
Selection.Value = B(i, j)
With Selection.Interior
.Color = RGB(255, 255, 200)
.Pattern = xlSolid
End With
If i = 1 Then
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
Next

'write the quotation template
For i = 1 To imax
For j = 1 To jmax
Worksheets("Sheet1").Range("B4:B4").Cells(imax + i, j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
End If
Next
Next
'uncomment next line to automatically copy a quotefalls picture to
the clipboard
'Worksheets("Sheet1").Range(Cells(4, 2), Cells(4 + 2 * imax - 1, 2
+ jmax - 1)) _
' .CopyPicture xlScreen, xlBitmap
Worksheets("Sheet1").Range("A1:A1").Select


End Sub 'Quotefalls

Sub Copy_to_Clipboard()
Worksheets("Sheet1").Range("B2:B2").Cells(imax, jmax).CopyPicture
xlScreen, xlBitmap
End Sub

'quicksort subroutine
Sub QSort(aData, iaDataMin, iaDataMax)
Dim Temp
Dim Buffer
Dim iaDataFirst
Dim iaDataLast
Dim iaDataMid

' Start current low and high at actual low/high
iaDataFirst = iaDataMin
iaDataLast = iaDataMax

' Error!
If iaDataMax <= iaDataMin Then Exit Sub

' Find the approx midpoint of the array
iaDataMid = (iaDataMin + iaDataMax) \ 2

' Pick a starting point
' assume the data *might* be in semi-sorted order already!
Temp = aData(iaDataMid)
Do While (iaDataFirst <= iaDataLast)
'Comparison here
Do While (aData(iaDataFirst) < Temp)
iaDataFirst = iaDataFirst + 1
If iaDataFirst = iaDataMax Then Exit Do
Loop

'Comparison here
Do While (Temp < aData(iaDataLast))
iaDataLast = iaDataLast - 1
If iaDataLast = iaDataMin Then Exit Do
Loop

' if low is <= high then swap
If (iaDataFirst <= iaDataLast) Then
Buffer = aData(iaDataFirst)
aData(iaDataFirst) = aData(iaDataLast)
aData(iaDataLast) = Buffer
iaDataFirst = iaDataFirst + 1
iaDataLast = iaDataLast - 1
End If
Loop

' Recurse if necessary
If iaDataMin < iaDataLast Then
QSort aData, iaDataMin, iaDataLast
End If

' Recurse if necessary
If iaDataFirst < iaDataMax Then
QSort aData, iaDataFirst, iaDataMax
End If

End Sub 'QSort
****************************************************************************************************************

Thanks! Much appreciated. Hope that someone can help out with this.

Cheers. :blush:D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top