Ooops
October 28, 2021, 15:12:35

Author Topic: Atom editor  (Read 2392 times)

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Atom editor
« Reply #15 on: August 23, 2021, 16:00:01 »
works even so "nested"

0.bas
Code: [Select]
color 15,0
?"we are in prog 0.bas"
?"press Enter"
pause
'if needed, enter full path to sbasicg.exe
run "sbasicg -n 8q.bas"
?
?"now we are back from 8q.bas"
pause
end

works fine with -r, but with -n is no need to press the back key

8q.bas
Code: [Select]
'The Eight Queens puzzle is the problem of placing
'eight chess queens on an 8x8 chessboard so that no
'two queens threaten each other. Thus, a solution
'requires that no two queens share the same row,
'column, or diagonal. The eight queens puzzle is an
'example of the more general n queens problem of
'placing n non-attacking queens on an nxn chessboard,
'for which solutions exist for all natural numbers n
'with the exception of n=2 and n=3.
'The following is adapted Pascal program by Niklaus
'Wirth. It finds all (and all FUNDAMENTAL) solutions
'to the 4-9 queens problem (or more)
color 15,0
while 1
  z=0:f=0:input "N-queens - Board dim(4-9) (0-end):",n
  if n<4 or n>9 then cls:delay 300:end
  dim s(n),t(2*n),u(-n to n),d(n),w():cls
  Srch(1)
  ?z;" total postions - ";len(w);" fundamental"
wend

sub Srch(c)
  local r
  for r=1 to n
    if !s(r) and !t(r+c) and !u(r-c)
      d(c)=r:s(r)=1:t(r+c)=1:u(r-c)=1
      if c<n
        Srch(c+1)
      else
        show
      fi
      s(r)=0:t(r+c)=0:u(r-c)=0
    fi
  next
end

sub show
a=""
if z
  k=ubound(w)
  for j=0 to k
    e=w(j):l=j+1
    for i=1 to n:if e(d(i))<>n+1-i then exit for
    next:if i>n then a=a+" RL-"+l
    for i=1 to n:if e(n+1-d(i))<>i then exit for
    next:if i>n then a=a+" RR-"+l
    for i=1 to n:if d(i)<>n+1-e(n+1-i) then exit for
    next:if i>n then a=a+" R2-"+l
    for i=1 to n:if d(i)<>n+1-e(i) then exit for
    next:if i>n then a=a+" HH-"+l
    for i=1 to n:if d(n+1-i)<>e(i) then exit for
    next:if i>n then a=a+" VV-"+l
    for i=1 to n:if d(n+1-e(i))<>n+1-i then exit for
    next:if i>n then a=a+" DN-"+l
    for i=1 to n:if d(e(i))<>i then exit for
    next:if i>n then a=a+" D1-"+l
  next
fi
if a="":f++:a=" * * * "+str(f):w << d:fi
z++:?z,:for i=1 to n do ?chr(96+i);d(i),:?a
end
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline johnno56

  • Jr. Member
  • **
  • Posts: 50
  • Logic is the beginning of Wisdom.
Re: Atom editor
« Reply #16 on: September 05, 2021, 21:32:00 »
Round157 asked, "How can sbasic.exe(console version) be used in the Atom editor?".

I have read through all the responses, I may have missed something, but the question, in my opinion, has not been answered. If 'yes' then how? I too would like to know. Because if it can, then perhaps, it will work with Geany (my editor of choice).

J
May your journey be free of incident.

Live long and prosper.

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Atom editor
« Reply #17 on: September 07, 2021, 07:43:37 »
Round157 asked, "How can sbasic.exe(console version) be used in the Atom editor?".
I have read through all the responses, I may have missed something, but the question, in my opinion, has not been answered. If 'yes' then how? I too would like to know. Because if it can, then perhaps, it will work with Geany (my editor of choice).
J
see attached pic
In geany (for Windows) now Compile (F8) run in SDL, and Execute (F5) run in console...
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline Aurel

  • Sr. Member
  • ****
  • Posts: 353
Re: Atom editor
« Reply #18 on: September 07, 2021, 09:41:59 »
I just found my AEdit for SB and check is still work   :o
yes work like a charm.. ;D

if anyone want to try/use let me know

(Y)

Offline bplus

  • Full Member
  • ***
  • Posts: 229
Re: Atom editor
« Reply #19 on: September 07, 2021, 11:26:16 »
I just found my AEdit for SB and check is still work   :o
yes work like a charm.. ;D

if anyone want to try/use let me know

@Aurel  And how did you setup the code for the Run button?

I ask because it (might) sort of answer johnno56's question about setting up Geany.

But really now, Chris has got sb back into a normal editor.
(Now if he could only make it run as fast as the g version. ;-))

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Atom editor
« Reply #20 on: September 07, 2021, 13:49:48 »
In Geany works syntax highlighting too as described in:
https://www.syntaxbomb.com/smallbasic/quick-question/msg347051511/#msg347051511

see pic below:
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline Aurel

  • Sr. Member
  • ****
  • Posts: 353
Re: Atom editor
« Reply #21 on: September 07, 2021, 20:16:44 »
Jsali...i don't say that geany don't have syntax coloring then that is slow and
clumsey to use ..for me ..and require configuration file (tommaz always patronize about that one   :P)

Mark..
On windows i use standard api call ShellExecute() to run program
but before that editor must know in which folder (directory) is sbasicg.exe to send
command line ...so this one not work on linux, linux use different method but still depend on path of file.

my editor only require to be in same folder where is located sbasicg.exe and nothing else.
I can even change that but then i need to add compiler path feature in config file.

soo..do i need to upload it here ?
(Y)

Offline Aurel

  • Sr. Member
  • ****
  • Posts: 353
Re: Atom editor
« Reply #22 on: September 07, 2021, 20:27:25 »
I just download and tested 12.23 with editor in sb32 folder
it is Mark program 3d sierpinski piramid and work fine
(Y)

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Atom editor
« Reply #23 on: September 07, 2021, 23:04:04 »
Jsali...i don't say that geany don't have syntax coloring then that is slow and
clumsey to use ..for me ..and require configuration file (tommaz always patronize about that one   :P)
.....
soo..do i need to upload it here ?

And I just wanted to complete the answer to Johno's question... as his favorite is geany... not to compete with anyone... In fact I don't use any syntax coloring as I'm colorblind, and nearsighted... and maybe a bit old... In illo tempore, I worked on teleprinter terminal... no syntax coloring, not even slashed O or 0...

And I was about to send an email to you that I'm interested... so, please, upload it here :)

No hard feelings  :)
« Last Edit: September 07, 2021, 23:23:18 by jsalai »
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline Aurel

  • Sr. Member
  • ****
  • Posts: 353
Re: Atom editor
« Reply #24 on: September 08, 2021, 20:57:39 »
Ok
In attachment is sb32 folder
when you unpack run AurelEditSB, run program clicking on >32
by the way editor you can use on 64bit windows too..

oups ...attachment is tooo limited .. :o
so iwill add link

https://aurelsoft.ucoz.com/sb32.zip
(Y)

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Atom editor
« Reply #25 on: September 08, 2021, 22:24:49 »
@Aurel: Thanks a lot.
Best!
 JS

PS. Works fine and fast....
Even my idiotic knight tour 90x50-1-1
and of course the marvelous B+'s "non recursive sierpinsky.bas"

Just not dark moon - I see nothing - just kidding (with a grain of truth) :)
« Last Edit: September 08, 2021, 23:05:38 by jsalai »
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline Aurel

  • Sr. Member
  • ****
  • Posts: 353
Re: Atom editor
« Reply #26 on: September 09, 2021, 19:32:50 »
thanks man i am glad that work

yes DarkMoon theme i made are with not so good colors choice..it
should be better,,,well i really very rare use dark themed editors ..i prefer
light themes...
but i will see..maybe i can improve it  ;D
(Y)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal