[Solved] Solving the Sudoku Puzzle using OO BASIC Calc macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Thank you Jeje for your link.

I'll look at the contents and see what I can do with it.

Right now I am in a big mess with Arrays.

What seemed to work before suddenly become not workable, with lots of variables not defined errors, after I introduced the RemoveItemFromArray function.

There seem to be some conflicts because I defined an array as string in some places, as variant in some others and as objects in yet in some other places. Even after I changed most of them to variant, there are still persistent errors in the place for uBound.

I haven't learnt up XRay tool yet, and don't know how to resolve the problem.

Let me get some sleep and look at the problem again. :x
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

How to detect duplicates in a 1-dimensional array of 9 elements of digits from 1 to 9

In my attempt to solve the Sudoku puzzle with OO BASIC, I come across a scenario where some cells have duplicates in a row, or column, or block of 3x3 cells, and this is not permitted by the Sudoku rules.

I have tried to solve it by making the 9 cells into a string and then replace the string against string 1 to 9 and compare the lengths. This works, but it is very, very tedious to loop through 9 cells each in 27 arrays, 9 rows, 9 columns, and 9 blocks.

Can anyone point me to some simpler ways, such as using sets, that have unique elements, or some ready built-in formula for arrays, collection, dictionary, whatever, in OO BASIC?

I tried to search the forum, and only found some built-in formula, but cell formula, only.
Openoffice 4.15
Windows 10
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Learning to program in OpenOffice Basic through Sudoku

Post by Zizi64 »

How to detect duplicates in a 1-dimensional array of 9 elements of digits from 1 to 9
The standard deviation of the integer numbers (1; 2; 3; 4; 5; 6; 7; 8; 9) is 2,73861278752583000. The result will be different when there are duplications.


I tried to search the forum, and only found some built-in formula, but cell formula, only.
You can call the cell formulas from your macro code. You can find sample code snippets in the forum.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Thank you for your info.

I probably would encounter 2 problem trying to use the standard deviation formula.
  • First my array is an array of string. Standard deviation probably only works for numbers.
  • Secondly, it only applies in the last stage where every cell is turned to a single digit. In the intermediate stage, we probably encounter a series more like, 1, 2, 358, 4, 4, 6, 8, 9, 7, where there is no way to predict the multi-digit cells.
As for using worksheet cell formula, I am touching the worksheet at 2 points in this application,
  • first, extracting the cell values from the worksheet into an array,
  • and lastly, returning the items from the array back to a different worksheet to display the result.
Worksheet cell formulae are mostly quite different from the macro version. I can search the forum to see if there are equivalents to be used in the macro.

Incidentally, is there any quite way to convert a string array into an array of integer?

For the time being, I am looping looping through the array and convert each item to integer.
  • It is like [using a butter knife to cut an overgrown tree at the backyard.]
Best regards.
Openoffice 4.15
Windows 10
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Learning to program in OpenOffice Basic through Sudoku

Post by Zizi64 »

First my array is an array of string.
Why you are using strings for this task????
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

I use the strings because in my immediate past project on [using style], I happened to learn some string function, such as replace(someString, aShorterString, ""). This is inline with Crook's idea of playing Sudoku with pencil and paper, striking off the digits that already occur in a row, column, or block of 3x3 cells.

I use it to remove single digits that are already there on the Sudoku board.

As another volunteer-advisor put it, I am using a hammer to butter the bread. As I go along the way, I may learn other more efficient methods to solve the Sudoku. This string function gets me going for the time being.

Another way to do it is probably to assess the worksheet / cell functions, and using the worksheet formulae to do the job.

There appear to be more array functions among the worksheet functions than the topics on arrays.

The learning curve is steeper than I imagined before I started learning OO BASIC programming.

I haven't embarked on learning the OO Base yet. Maybe some database functions may fit the model better?
Openoffice 4.15
Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Learning to program in OpenOffice Basic through Sudoku

Post by RoryOF »

Stay away from Base for a time! Carry on with your current programming. Base has been known to drive people mad!
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Ok. Thanks.
Point taken.
Even the current programming is driving me half mad, as the codes seems to work sometime, and than not at other time, and I have great difficulty in locating the problems!
Openoffice 4.15
Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by JeJe »

There are VB6 and Excel VBA codes here that might help you. OOBasic is fairly close to VB6 and a lot of VB6 code can run with little modification.

http://www.planet-source-code.com/vb/sc ... ria=soduku
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Hi. Jeje.
Thanks for the link.
I downloaded the code sample and took a look at the codes.
Unfortunately, I don't understand, how, and why the codes work.
For one thing, it appears to make use of matrix.
I couldn't find tutorials in matrix in OO Basic so far.
I am back to use my hammer to butter my bread,
and continue to saw the tree with my butter knife. :oops:
Best regards.
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

What is the difference between array copy and array clone in OO BASIC?

When removing extra digits from cells comes to stand still, taking into account all the single digits already occupying the cells in the same row, column, or 3x3 block, I try to take a cell with 2 digits, insert one of them into the cell, and saving the other in an array for future use.

I was happily doing this for a while until later, I found that what array is retrieved from the array storing the saved arrays is different from what was saved.

In fact, what is retrieved look like what has been processed in the later steps.

It occurred to me that perhaps when I copied and saved a modified copy of an array, I had somehow cloned a copy that still keeps connected to the current array being processed and was being processed. When this greatly different copy was loaded, very crazy result occurred.

How best to copy an array by value that will remain unchanged and can be retrieved for future use?

I can't proceed for the time being until this is resolved.

Can someone please help?
Openoffice 4.15
Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by JeJe »

Lupp posted on this here. Use Redim preserve to create to create an independent copy of an array.

viewtopic.php?f=21&t=93610
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Thank you. Jeje.

I'll read through the post and see if I can learn to apply it. :D

Hopefully, this will bring me one step closer to solving the Sudoku puzzle. I am sort of creating my own depth-first-search approach, I think?
Last edited by OldStd on Fri Oct 26, 2018 9:49 am, edited 1 time in total.
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Hi. Everyone.
It looks like each time the array is to be used, the first function will be re-run for the entire cycle. That would be processing from cell 1 to cell 80 to remove all the unwanted digits, every single time the second process is making use of the result array?!
This topic was deleted because I have found out it was caused by an internal error in the function that has nothing to do with arrays.
It occured because I copied and pasted the codes from the first function to make a new function, but forgot to change the variable name of the return value of the second function.

Apologies.
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Sample Sudoku puzzle solved
Sample Sudoku puzzle solved
Hi. Everyone.
While I am still tidying up the codes for step 3 (Choosing a value from a double digit cell) and step 4 (retrieving the saved value when the first choice turns out to be wrong), the game is conceptually solved for the sample Sudoku game I originally displayed at the beginning of this discussion.
I have used the codes to generate the results for applying step 1 & 2: Removing single digits from the the string 123456789 and looking for unique value in a cell in a row, column, or 3x3 block, but manually pick the first value and apply the codes. The resulting solution of this sample, is shown in the attached picture.
Regards.
Attachments
Zoom into the solved game
Zoom into the solved game
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

Hi. John_Ha, RoryOF, Zizi46, robleyd , and Jeje, and everyone who is following the discussion.

Finally, while I still need to tidy up my codes, I have a complete program that solves the Sudoku puzzle, or at least to 3 samples I feed to it. Each puzzle was solved in between 9 to 15 seconds.

The [strategy] or [algorithm] I used is as follows:
  • Step 1
    • Fill each blank cell with a string 123456789
  • Step 2
    • In each cell, remove the digits that occur in the row, the column, and the 3x3 block that contains the cell, and update the cell with the remaining string.
      Repeated this process until no more digits can be removed from any cell.
      I use an iterative procedure to run through each row from row 0 to row 8, and then through column 0 to column 8, and then block 0 to block 8.
  • Step 3
    • In each row, column, block, look for a cell that contains a digit that is unique to the row, column, or block, and then update the value of the cell with the digit found. Repeat this for every cell through each row, column, and block.
      Go back to repeat step 2 followed by Step 3, until no more digit can removed and no more unique value can be found.
  • Step 4
    • Go through each row, column, block until a first cell with only 2 digits is encountered. Choose the left digit and update the cell with this digit, save the right digit together with the entire array of 81 cells in a new array and store this array in another array, that I name as oArr.
    • Repeat Step 2 and Step 3 with this new found clue until it can't go on any further.
      At this point 2 options are available.
      If there are no duplicates so far, then go to Step 4.
      The other option is that if duplicates of single digits are found in any row, column, or block, then apply step 5.
  • Step 5
    • Retrieve the top element from the array oArr, that is an array saved in Step 4 earlier, and remove the top element (that is the same array retrieved). The chosen array is passed back to Step 2, and the iteration of Step 2, Step through Step 4 repeat themselves until a Step 5 is necessary.
      The iteration keeps on going until the game is completely solved.
Throughout the program, the most used tools from OO Basic Calc are
  • Array, Array function like: UBOUND
  • and some array functions copied from the web:
    fnAddItemToArray, fnRemoveItemFromArray
  • string functions like LEN, REPLACE, MID, LEFT, RIGHT, CSTR, INT.
  • and looping function like FOR
Perhaps I didn't learn all that much of the OO BASIC but it has been a rewarding learning experience.

Thanks to all of you for giving me the advice and support on the way.

Now, I have to go back to learn how to use the Xray tools.

Code: Select all

Sub Main
rem Clear oArr of old arrays stored
	u = UBound(oArr)
	for i = u to 0 step -1
		RemoveItemFromyArr(oArr, i)
	next i
	outArr0 = fn0sht2Array
	outArr1 = fn1fillBlanks(outArr0)
	outArr2 = fn2delSngl (outArr1)
	outArr3 = fn3getUniques(outArr2)
	inarr = outarr3
	for k = 1 to 10
		outArr23 = fn2n3loops(inarr)
		if not fnsolved(outarr23) then
			outArr34 = fn3n4loops(outArr23)
		end if
		if not fnsolved(outarr34) then
			outArr45 = fn4n5loops(outArr34)
		end if
		inarr = outArr45
		if fnsolved (outArr23) then
			calldisplay(outArr23)
			msgbox "solved!" & "   k= " & k
		exit for
		end if
	next k
End Sub
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: Learning to program in OpenOffice Basic through Sudoku

Post by OldStd »

RoryOF wrote:This is like learning a language and at the same time writing the Great XXXX Novel in that language. I suggest you concentrate on learning one programming language, outside of OO - something such as Python - a good book on this at
A Byte of Python

Having learned Fortran 2 and progressed to BASIC, with excursions through C, Pascal, Modula, Java, I advise against learning a procedural language first, hence my suggestion of Python.
When I was first exposed to computer programming, I couldn't even find a computer book to buy in the town I lived in. A friend gave me an old manual on Lotus 123 that I read from cover to cover. Later I was exposed to Micro Excel and started learning a bit of VBA, entirely on the help documentation attached to the Excel as I couldn't but any programming book then. I didn't take any computer course of any kind then.
Nowadays we are flooded with free ebooks on all kinds of computer languages in the Internet until I don't know what to choose or follow.
I am a bit confused over the advice of RoryOF above.
Does it mean it is best for me to temporarily forget about learning OO BASIC and start learning Python instead?
Elsewhere I also read that Python is the number one computer language to learn in term of wide application and better earning potential. Perhaps I should seriously take on the advice and switch over to learn Python from now on?
I glanced through an eBook I downloaded on the chapter on
  • . It appears that I could use list instead of array to develop the solution of Sudoku, for example, as list provides a lot more functionalities than array. I don't know, as I haven't tried it yet.
Openoffice 4.15
Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by JeJe »

If your goal is learning something which has wide application and earning potential - then OO Basic probably is not the thing to learn. You can see from the number of people here that very few people are programming in OO Basic, its difficult to learn compared with VBA, and you'd only want to learn it if you wanted to do something with OpenOffice. Take a look at the jobs where you are and what languages are being asked for now and might be in the future.

If you do want to do something with OO then there's disagreement here about what's best to use. I like Basic as its what I know already and its simple and quick to develop in. There's also a lot of Basic code out there that can be easily adapted for use in OOBasic. Others here strongly disagree...
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by Villeroy »

The attached document used to be an xls document when I downloaded it. This is a partial sudoku solver with no macro. Enter or paste values into the blue range on sheet #1. The yellow range shows the solution. This document demonstrates the mind set of a good programmer.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by JeJe »

Villeroy - there's no attached document.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by Villeroy »

JeJe wrote:Villeroy - there's no attached document.
:oops:
Too big to be uploaded here: http://www.mediafire.com/file/4fmq27hhy ... 1.ods/file
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by OldStd »

Hi. Jeje.

I first started learning OO BASIC by trying to automate the numbering styling by recording a macro but got stuck as I didn't know how to paste special from OO Calc to writer. That was when I posted a question to ask for help in this forum. I was promptly advised to forget macro recording and learn to program in API. As I completed this [project], I started to wonder if I could solve the Sudoku using the OO BASIC. Hence this second series of questions in this forum.
Right now, my interest in programming in OO BASIC is still that of a hobbyist.
I doubt I can get any substantial employment even if I master the programming in OO BASIC.
As I remember a quote from a Shakespearean drama where the crown Falstaff 
made the famous quote:

“It is full of sounds and fury, signifying nothing”
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by OldStd »

Villeroy wrote:
JeJe wrote:Villeroy - there's no attached document.
:oops:
Too big to be uploaded here: http://www.mediafire.com/file/4fmq27hhy ... 1.ods/file
Hi. Villeroy.

Thanks for the link.
I downloaded the .ods file and took a look at the method used.
It looks at 3 columns or 3 rows at a time. A digit can only appear once in each of the 3 columns, and each digit must occur in a different 3x3 block with the same 3 columns or 3 rows. So if a digit has appeared in 2 of the columns, it is possible to locate the feasible block and column where the 3rd position of the digit is to be located.
While it is easy to understand the concept by visually inspection, I found it too difficult to translate that into computer logic.
I am especially limited by the lack of the basic knowledge of the language to use this approach.
I looked at the methods used in the worksheet cell formulae and note that the author makes use binary. I am also not quite familiar with that. Other cell formula like SEARCH is new to me, too.
Cell formula such as DEC2BIN is simply Dutch to me. I am totally lost.

That said, the approach I am using is much more intuitive to me, as I use part of the method mentioned by Crook in his article/book, solving Sudoku puzzles using pen and paper, where he fills up each blank with 123456789 and then delete from this string all digits from the row, column, and the 3x3 block that contains the cell.
Using this method alone, many new clues (cell with a single digit) can be found.
Later, I read somewhere else that in each row, column, or block, although each cell still contains many digits, sometimes there is one cell that has a unique digit for the entire row, column, or block. This is easy for me to program for that.
Together with these 2 methods many clues can be found.
Then it comes a time where application of the 2 steps generate no further clues.
This is where I applied a new concept introduced by other programmers: Depth-first-search.
Here, I choose one value from a cell with a 2 digit number, insert it to the cell, and keep the other value together with the whole array, to be retrieved in future in case this was a wrong choice. We keep repeating the last 3 steps as far down as possible until something is wrong.
This part is called the depth-first search.
Normally, the sign that something is wrong is when double entries of clues are found in a row, or column, or block.
I was able to figure out how to write codes to detect the doubles.
When doubles are detected, the saved array is retrieved for use, and that same array is removed from the storage array.
This step is called retracting.
Putting these strategies together, and using the fast calculation of the CALC using FOR loops to repeat the processing, a reasonably difficult Sudoku puzzle can be solved within 10 to 15 seconds.
I am using familiar string functions like LEN, LEFT, RIGHT, MID, REPLACE to solve this processing, and a couple of newly learned array functions to add an item to an array, and to remove an item from an existing array.

As I progress in OO BASIC programming, or other programming like Python, and as I learn to use other functions, I may try to solve this Sudoku game in a different way, later.

In the meantime, I am still trying to tidy up my codes as sometime when I make minor changes, there was an error message flushing: “Not enough stack memory”. A search reveals the course: “Too many recursions”. I have yet to learn to deal with this.
Openoffice 4.15
Windows 10
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by OldStd »

Hi. Everyone.
When I first started this topic of discussion, I was more interested to learn some aspects of OO BASIC through solving the Sudoku puzzles.
By some lucks, I hit on using some arrays and string functions, I have found a simple set of logic to solve it.
Now that the logical, algorithmic part of the solution is working, I am wondering how to send this application to my handphone so that I can play Sudoku game anywhere, anytime.
Has anybody any experience in sending an OO BASIC application to the handphone?
Shall I create a new topic? And under which sub forum?
Thanks and regards.
Openoffice 4.15
Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by Villeroy »

You need OpenOffice and StarBasic on your phone. In other words: you need a bulldozer for the strawberry bed in your front garden.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by OldStd »

Villeroy wrote: Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m
by Villeroy » Fri Nov 02, 2018 7:58 am

You need OpenOffice and StarBasic on your phone. In other words: you need a bulldozer for the strawberry bed in your front garden.
Hi Villeroy.
Thanks for your response. I noted you had joined this forum since 2007, and that is a long time ago. If you say this can't be done, then it can't be done.
I also note that while we can download some free version of Microsoft Excel in the phone, we can't write macro with it.
So OpenOffice and StarBasic is out for the phone.
What about posting the OO BASIC application in the web? Is that possible, or if not, what other [easy] programming language can we use to host it in the web that we can download and play in the browser in my PC? or even download the web app into my phone then? Python, perhaps? or OO Calc + Python?
Anybody has any experience in hosting an app in the web?

Shall I post this question as a new topic in another forum?

Talking about strawberry and bulldozer remains me of a story I read when I was a child:

There was this little boy in a poor country who was extremely good with plants. He was known as the plant doctor in his neighbourhood. He used to plant peanuts. As he had no other resources he developed the humble peanuts into all sorts of products and pulled the people around him out of poverty. At that time, there was no Google, and I didn't find out who he was and which country he was from.
Later, I read that there was another boy in a big Western country who grew peanuts, became a peanut farmer, and eventually became the PRESIDENT of that country!
So I guess if we put our mind to it, we can do wonders with some simple programming language? :lol:
Last edited by OldStd on Fri Nov 02, 2018 5:16 am, edited 1 time in total.
Openoffice 4.15
Windows 10
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by robleyd »

All these questions are outside the scope of this forum really. There is a third party port called AndropenOffice which may or may not support OOBasic, but it isn't an Apache product and I doubt anyone here knows anything about it, based on the few enquiries that have appeared here.

Search the interwebs for a suitable language that is used for developing apps for whatever type of handy you use.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by OldStd »

robleyd wrote:All these questions are outside the scope of this forum really. There is a third party port called AndropenOffice which may or may not support OOBasic, but it isn't an Apache product and I doubt anyone here knows anything about it, based on the few enquiries that have appeared here.

Search the interwebs for a suitable language that is used for developing apps for whatever type of handy you use.
Hi. robleyd.
Thanks for the response.
I'll try to search elsewhere, and try to search in [Andropenoffice], too.
Openoffice 4.15
Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by JeJe »

What about posting the OO BASIC application in the web? Is that possible, or if not, what other [easy] programming language can we use to host it in the web that we can download and play in the browser in my PC? or even download the web app into my phone then? Python, perhaps? or OO Calc + Python?
OO is not meant for standalone BASIC applications. If you want to port your basic code so that it runs on your phone then google BASIC compiler plus the name of whatever OS your phone runs on.

Try googling javascript Soduko for several results.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
OldStd
Posts: 116
Joined: Tue Sep 11, 2018 8:46 pm

Re: [Solved] Solving the Sudoku Puzzle using OO BASIC Calc m

Post by OldStd »

A comparison
A comparison
Try googling javascript Soduko for several results.
Hi. Jeje.
Thanks for the suggestion.
I'll search for the answers.
In the meantime, I have browsed the web for Javascript solutions to Sudoku.
One thing that impressed me is that their solutions are so fast, finishing the solution in ms.
One site explains the steps used, [naked single], [hidden single], that I have used, and X-wing, that I have read about and have seen manual examples, but I don't know how to code for.
Another website with an .edu extension employs the first two singles and no further steps and so leaves the solution hanging as unfinished.
So I am half way between the two sets of solutions, as my solution is complete, but much slower, as it takes between 4.5 to 14 seconds to do the job.
Openoffice 4.15
Windows 10
Post Reply