locked
Publish and import code from http://www.smallbasic.com/program/ RRS feed

  • Question

  • Hi Team,

    I am trying to publish and import code from http://www.smallbasic.com/smallbasic.com/program/ programmatically.

    Kindly suggest some ideas in small basic or VisualBasic .net or C#

    Thanks,


    Roshan - 7th Grade Student (Age 11) - Learning Small Basic



    Wednesday, October 18, 2017 6:26 AM

Answers

  • SmallBasic's program IDNo consists of three alphabets and three-digit numbers.
    The number of combinations is 26 * 26 * 26 * 1000 = 17,576,000.

    The program to check the program ID number of Small Basic is shown below.
    This checks 1,000 No from "RTL000" to "RTL999", but takes about 155 seconds.
    32 days are required to check all 17,576,000 IDNos.
    However, although you know IDNo, you do not know what the program is like without downloading the program.

    '   This program searches   if  given program code exists or not.     and  make   a  code list .
    '  In this case  search  program code =  RTL???     
    Key_Letter()
    i=18 'For i= 1 To Text.GetLength(D[1])     '  18----> R
    c1=Text.GetSubText(D[1],i,1)
    j=20 '  For j=1 To Text.GetLength(D[1])    '  20---->T
    c2=Text.GetSubText(D[1],j,1)
    k=12'    For k=1 To Text.GetLength(D[1])   '  12----->L
    c3=Text.GetSubText(D[1],k,1)
    For L=0 To 999
      Key_code=text.Append(c1+c2+c3,Text.GetSubTextToEnd(1000+L,2))
      main()
    EndFor 
    '    EndFor
    '  EndFor
    'EndFor
    Sub main
      url="http://smallbasic.com/program/?"+Key_code
      RD= Network.GetWebPageContents(url)
      If Text.IsSubText(RD,errmesg) then
        TextWindow.WriteLine(Key_code+"--None--")
      Else
        nnn=nnn+1
        TextWindow.WriteLine(Key_code+"-----Keycode Exist-----")
        File.WriteLine(Program.Directory+"\KeyCodeList.txt",nnn,Key_code)
      endif
    Endsub
    Sub Key_Letter
      D[1]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
      File.DeleteFile(Program.Directory+"\KeyCodeList.txt")
      DQ=text.GetCharacter(34)
      errmesg="<div id="+dq+"codeListing"+DQ+"><span class='Identifier'>error</span><br />"
    EndSub


    Thursday, October 19, 2017 7:07 AM
    Answerer
  • Best and most simple way would be to use RegEx, ID: KFB062

    Tested with 2 different IDs (1. SB code only and 2. SB containing CS code) and compared to the original imports via IDE. The results are different in blanks only.

    The Regex sure can be improved and there may be IDs (with eg. special comments aso.) where the cleaning fails.


    Thursday, November 2, 2017 9:50 PM
    Answerer
  • I have no idea about publish, but I have an idea about import.

    Following code is a part of http://smallbasic.com/program/?NML535-2 .  You can use Network.GetWebPageContents() like NaochanON's program.  Then find "<!-- Program Listing -->" as the beginning of the program.  Remove tags except "<br />".  "<br />" should be replaced by Text.GetCharacter(10).  And "</div>" is the program end.

    Some programs may be broken that have HTML tags (e.g. "<h1>") or character references (e.g. "&amp;") in text literals.

          
    	    <!-- Program Listing -->
          <div id="codeListing"><span class='Comment'>' Pirate Ship</span><br />
    <span class='Comment'>' Version 0.3</span><br />
    <span class='Comment'>' Copyright © 2017 Nonki Takahashi.  The MIT License.</span><br />
    <span class='Comment'>' Program ID NML535-2</span><br />
    <span class='Comment'>' Last update 2017-10-25 - workaround for known issue 43905</span><br />
    <span class='Comment'>' 2017-05-15 20:30:21 Shapes generated by Shapes 2.21b.</span><br />
    <span class='Comment'>'</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>Title</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"Pirate Ship 0.3"</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>BackgroundColor</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"SkyBlue"</span><br />
    <span class='Identifier'>SB_Workaround</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    <span class='Identifier'>gw</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>598</span><br />
    <span class='Identifier'>gh</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>428</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>Width</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>gw</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>Height</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>gh</span><br />
    <span class='Comment'>' initialize shapes</span><br />
    <span class='Identifier'>Shapes_Init</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    <span class='Comment'>' add shapes</span><br />
    <span class='Identifier'>scale</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>1</span><br />
    <span class='Identifier'>angle</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>0</span><br />
    <span class='Identifier'>iMin</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>1</span><br />
    <span class='Identifier'>iMax</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>93</span><br />
    <span class='Identifier'>Shapes_Add</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    <span class='Identifier'>cx</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>260</span><br />
    <span class='Identifier'>cy</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Operator'>-</span><span class='NumericLiteral'>20</span><br />
    <span class='Identifier'>h</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>350</span><br />
    <span class='Identifier'>a</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>20</span><br />
    <span class='Identifier'>_a</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>GetRadians</span><span class='Operator'>(</span><span class='Identifier'>a</span><span class='Operator'>)</span><br />
    <span class='Identifier'>w2</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>h</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='NumericLiteral'>2</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>Sin</span><span class='Operator'>(</span><span class='Identifier'>_a</span><span class='Operator'>)</span><br />
    <span class='Identifier'>w1</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>30</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>Sin</span><span class='Operator'>(</span><span class='Identifier'>_a</span><span class='Operator'>)</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenWidth</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>8</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenColor</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"#000000"</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>DrawEllipse</span><span class='Operator'>(</span><span class='Identifier'>shX</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cx</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>shY</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cy</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>30</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>30</span><span class='Operator'>)</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenWidth</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>16</span><br />
    <span class='Keyword'>For</span>&nbsp;<span class='Identifier'>i</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>1</span>&nbsp;<span class='Keyword'>To</span>&nbsp;<span class='NumericLiteral'>2</span><br />
    &nbsp;&nbsp;<span class='Identifier'>pole</span><span class='Illegal'>[</span><span class='Identifier'>i</span><span class='Illegal'>]</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>AddLine</span><span class='Operator'>(</span><span class='Operator'>(</span><span class='Identifier'>i</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>1.5</span><span class='Operator'>)</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Identifier'>w1</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>0</span><span class='Operator'>,</span>&nbsp;<span class='Operator'>(</span><span class='Identifier'>i</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>1.5</span><span class='Operator'>)</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Identifier'>w2</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>h</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>)</span><br />
    &nbsp;&nbsp;<span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>Move</span><span class='Operator'>(</span><span class='Identifier'>pole</span><span class='Illegal'>[</span><span class='Identifier'>i</span><span class='Illegal'>]</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>shX</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cx</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>shY</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cy</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>)</span><br />
    <span class='Keyword'>EndFor</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenWidth</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>0</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>BrushColor</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"#999999"</span><br />
    <span class='Identifier'>y</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>shY</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cy</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>h</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>5</span><br />
    <span class='Identifier'>ground</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>AddRectangle</span><span class='Operator'>(</span><span class='Identifier'>gw</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>gh</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='Identifier'>y</span><span class='Operator'>)</span><br />
    <span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>Move</span><span class='Operator'>(</span><span class='Identifier'>ground</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>0</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>y</span><span class='Operator'>)</span><br />
    <span class='Keyword'>While</span>&nbsp;<span class='StringLiteral'>"True"</span><br />
    &nbsp;&nbsp;<span class='Identifier'>angle</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>10</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>Sin</span><span class='Operator'>(</span><span class='Identifier'>_a</span><span class='Operator'>)</span><br />
    &nbsp;&nbsp;<span class='Identifier'>Shapes_Rotate</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    &nbsp;&nbsp;<span class='Identifier'>_a</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>_a</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='NumericLiteral'>0.1</span><br />
    &nbsp;&nbsp;<span class='Object'>Program</span><span class='Operator'>.</span><span class='Identifier'>Delay</span><span class='Operator'>(</span><span class='NumericLiteral'>100</span><span class='Operator'>)</span><br />
    <span class='Keyword'>EndWhile</span><br />
    <br />

     

    Nonki Takahashi

    • Marked as answer by [Roshan_Kumar] Thursday, November 2, 2017 5:06 PM
    Thursday, November 2, 2017 4:34 PM
  • a bit enhanced sb app finder: PMT388

    • loops through all 1000 codes
    • selects only longer apps (min 100 lines cca)
    • checks for autoremarked sb lines
    • displays initial rem lines
    • puts the last found code in clipbrd

    the 1st num in title indicates total found files. however the ones shorter than 100 lines are skiped.
    the second num in title is averaged size of skipped apps

    the listed apps display code, size and numb. of lines, and also some rem. lines.
    many apps have autorem lines which have to be unmarked in order to run app correctly



    • Edited by Tryhest Monday, November 6, 2017 5:02 AM
    • Marked as answer by [Roshan_Kumar] Monday, November 6, 2017 12:07 PM
    Monday, November 6, 2017 4:51 AM

All replies

  • SmallBasic's program IDNo consists of three alphabets and three-digit numbers.
    The number of combinations is 26 * 26 * 26 * 1000 = 17,576,000.

    The program to check the program ID number of Small Basic is shown below.
    This checks 1,000 No from "RTL000" to "RTL999", but takes about 155 seconds.
    32 days are required to check all 17,576,000 IDNos.
    However, although you know IDNo, you do not know what the program is like without downloading the program.

    '   This program searches   if  given program code exists or not.     and  make   a  code list .
    '  In this case  search  program code =  RTL???     
    Key_Letter()
    i=18 'For i= 1 To Text.GetLength(D[1])     '  18----> R
    c1=Text.GetSubText(D[1],i,1)
    j=20 '  For j=1 To Text.GetLength(D[1])    '  20---->T
    c2=Text.GetSubText(D[1],j,1)
    k=12'    For k=1 To Text.GetLength(D[1])   '  12----->L
    c3=Text.GetSubText(D[1],k,1)
    For L=0 To 999
      Key_code=text.Append(c1+c2+c3,Text.GetSubTextToEnd(1000+L,2))
      main()
    EndFor 
    '    EndFor
    '  EndFor
    'EndFor
    Sub main
      url="http://smallbasic.com/program/?"+Key_code
      RD= Network.GetWebPageContents(url)
      If Text.IsSubText(RD,errmesg) then
        TextWindow.WriteLine(Key_code+"--None--")
      Else
        nnn=nnn+1
        TextWindow.WriteLine(Key_code+"-----Keycode Exist-----")
        File.WriteLine(Program.Directory+"\KeyCodeList.txt",nnn,Key_code)
      endif
    Endsub
    Sub Key_Letter
      D[1]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
      File.DeleteFile(Program.Directory+"\KeyCodeList.txt")
      DQ=text.GetCharacter(34)
      errmesg="<div id="+dq+"codeListing"+DQ+"><span class='Identifier'>error</span><br />"
    EndSub


    Thursday, October 19, 2017 7:07 AM
    Answerer
  • I have no idea about publish, but I have an idea about import.

    Following code is a part of http://smallbasic.com/program/?NML535-2 .  You can use Network.GetWebPageContents() like NaochanON's program.  Then find "<!-- Program Listing -->" as the beginning of the program.  Remove tags except "<br />".  "<br />" should be replaced by Text.GetCharacter(10).  And "</div>" is the program end.

    Some programs may be broken that have HTML tags (e.g. "<h1>") or character references (e.g. "&amp;") in text literals.

          
    	    <!-- Program Listing -->
          <div id="codeListing"><span class='Comment'>' Pirate Ship</span><br />
    <span class='Comment'>' Version 0.3</span><br />
    <span class='Comment'>' Copyright © 2017 Nonki Takahashi.  The MIT License.</span><br />
    <span class='Comment'>' Program ID NML535-2</span><br />
    <span class='Comment'>' Last update 2017-10-25 - workaround for known issue 43905</span><br />
    <span class='Comment'>' 2017-05-15 20:30:21 Shapes generated by Shapes 2.21b.</span><br />
    <span class='Comment'>'</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>Title</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"Pirate Ship 0.3"</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>BackgroundColor</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"SkyBlue"</span><br />
    <span class='Identifier'>SB_Workaround</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    <span class='Identifier'>gw</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>598</span><br />
    <span class='Identifier'>gh</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>428</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>Width</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>gw</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>Height</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>gh</span><br />
    <span class='Comment'>' initialize shapes</span><br />
    <span class='Identifier'>Shapes_Init</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    <span class='Comment'>' add shapes</span><br />
    <span class='Identifier'>scale</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>1</span><br />
    <span class='Identifier'>angle</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>0</span><br />
    <span class='Identifier'>iMin</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>1</span><br />
    <span class='Identifier'>iMax</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>93</span><br />
    <span class='Identifier'>Shapes_Add</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    <span class='Identifier'>cx</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>260</span><br />
    <span class='Identifier'>cy</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Operator'>-</span><span class='NumericLiteral'>20</span><br />
    <span class='Identifier'>h</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>350</span><br />
    <span class='Identifier'>a</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>20</span><br />
    <span class='Identifier'>_a</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>GetRadians</span><span class='Operator'>(</span><span class='Identifier'>a</span><span class='Operator'>)</span><br />
    <span class='Identifier'>w2</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>h</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='NumericLiteral'>2</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>Sin</span><span class='Operator'>(</span><span class='Identifier'>_a</span><span class='Operator'>)</span><br />
    <span class='Identifier'>w1</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>30</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>Sin</span><span class='Operator'>(</span><span class='Identifier'>_a</span><span class='Operator'>)</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenWidth</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>8</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenColor</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"#000000"</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>DrawEllipse</span><span class='Operator'>(</span><span class='Identifier'>shX</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cx</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>shY</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cy</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>30</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>30</span><span class='Operator'>)</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenWidth</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>16</span><br />
    <span class='Keyword'>For</span>&nbsp;<span class='Identifier'>i</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>1</span>&nbsp;<span class='Keyword'>To</span>&nbsp;<span class='NumericLiteral'>2</span><br />
    &nbsp;&nbsp;<span class='Identifier'>pole</span><span class='Illegal'>[</span><span class='Identifier'>i</span><span class='Illegal'>]</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>AddLine</span><span class='Operator'>(</span><span class='Operator'>(</span><span class='Identifier'>i</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>1.5</span><span class='Operator'>)</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Identifier'>w1</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>0</span><span class='Operator'>,</span>&nbsp;<span class='Operator'>(</span><span class='Identifier'>i</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>1.5</span><span class='Operator'>)</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Identifier'>w2</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>h</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>)</span><br />
    &nbsp;&nbsp;<span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>Move</span><span class='Operator'>(</span><span class='Identifier'>pole</span><span class='Illegal'>[</span><span class='Identifier'>i</span><span class='Illegal'>]</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>shX</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cx</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>shY</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cy</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='NumericLiteral'>15</span><span class='Operator'>)</span><br />
    <span class='Keyword'>EndFor</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>PenWidth</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>0</span><br />
    <span class='Object'>GraphicsWindow</span><span class='Operator'>.</span><span class='Identifier'>BrushColor</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='StringLiteral'>"#999999"</span><br />
    <span class='Identifier'>y</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>shY</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>cy</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='Identifier'>h</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='NumericLiteral'>5</span><br />
    <span class='Identifier'>ground</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>AddRectangle</span><span class='Operator'>(</span><span class='Identifier'>gw</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>gh</span>&nbsp;<span class='Operator'>-</span>&nbsp;<span class='Identifier'>y</span><span class='Operator'>)</span><br />
    <span class='Object'>Shapes</span><span class='Operator'>.</span><span class='Identifier'>Move</span><span class='Operator'>(</span><span class='Identifier'>ground</span><span class='Operator'>,</span>&nbsp;<span class='NumericLiteral'>0</span><span class='Operator'>,</span>&nbsp;<span class='Identifier'>y</span><span class='Operator'>)</span><br />
    <span class='Keyword'>While</span>&nbsp;<span class='StringLiteral'>"True"</span><br />
    &nbsp;&nbsp;<span class='Identifier'>angle</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='NumericLiteral'>10</span>&nbsp;<span class='Operator'>*</span>&nbsp;<span class='Object'>Math</span><span class='Operator'>.</span><span class='Identifier'>Sin</span><span class='Operator'>(</span><span class='Identifier'>_a</span><span class='Operator'>)</span><br />
    &nbsp;&nbsp;<span class='Identifier'>Shapes_Rotate</span><span class='Operator'>(</span><span class='Operator'>)</span><br />
    &nbsp;&nbsp;<span class='Identifier'>_a</span>&nbsp;<span class='Operator'>=</span>&nbsp;<span class='Identifier'>_a</span>&nbsp;<span class='Operator'>+</span>&nbsp;<span class='NumericLiteral'>0.1</span><br />
    &nbsp;&nbsp;<span class='Object'>Program</span><span class='Operator'>.</span><span class='Identifier'>Delay</span><span class='Operator'>(</span><span class='NumericLiteral'>100</span><span class='Operator'>)</span><br />
    <span class='Keyword'>EndWhile</span><br />
    <br />

     

    Nonki Takahashi

    • Marked as answer by [Roshan_Kumar] Thursday, November 2, 2017 5:06 PM
    Thursday, November 2, 2017 4:34 PM
  • Best and most simple way would be to use RegEx, ID: KFB062

    Tested with 2 different IDs (1. SB code only and 2. SB containing CS code) and compared to the original imports via IDE. The results are different in blanks only.

    The Regex sure can be improved and there may be IDs (with eg. special comments aso.) where the cleaning fails.


    Thursday, November 2, 2017 9:50 PM
    Answerer
  • Hi Team,

    Thanks for all your import Ideas.

    Thanks,


    Roshan - 7th Grade Student (Age 11) - Learning Small Basic


    Friday, November 3, 2017 2:26 AM
  • nice way to find interesting listings. however i found many idiotic apps which repeat same line over and over again.these should be removed by admin
    Saturday, November 4, 2017 5:48 PM
  • a bit enhanced sb app finder: PMT388

    • loops through all 1000 codes
    • selects only longer apps (min 100 lines cca)
    • checks for autoremarked sb lines
    • displays initial rem lines
    • puts the last found code in clipbrd

    the 1st num in title indicates total found files. however the ones shorter than 100 lines are skiped.
    the second num in title is averaged size of skipped apps

    the listed apps display code, size and numb. of lines, and also some rem. lines.
    many apps have autorem lines which have to be unmarked in order to run app correctly



    • Edited by Tryhest Monday, November 6, 2017 5:02 AM
    • Marked as answer by [Roshan_Kumar] Monday, November 6, 2017 12:07 PM
    Monday, November 6, 2017 4:51 AM