Type your ugBASIC program here (remember: keywords like PRINT must be UPPERCASE!).
Click on Build menu to select the target: you will download the compiled binary file!

BITMAP ENABLE (2) CONST spriteCount = 8 DEFINE TASK COUNT spriteCount DIM sprites AS SPRITE (spriteCount) DIM x AS POSITION (spriteCount) DIM y AS POSITION (spriteCount) spriteImage = LOAD IMAGE("drop.png") GLOBAL sprites,x,y,spriteImage PARALLEL PROCEDURE dropDown SPRITE [sprites] ENABLE DO [x] = RANDOM WIDTH FOR [y] = 0 TO SCREEN HEIGHT + IMAGE HEIGHT(spriteImage) SPRITE [sprites] AT [x], [y] COLOR BLUE NEXT LOOP END PROC drops = 0 dropskip = (BYTE) ( SPRITE HEIGHT * 2 ) FOR i=0 TO SPRITE COUNT -1 sprites(i) = SPRITE(spriteImage) NEXT SPAWN dropDown DO IF drops < (spriteCount-1) THEN DEC dropskip IF dropskip = 0 THEN SPAWN dropDown dropskip = SPRITE HEIGHT INC drops ENDIF ENDIF RUN PARALLEL LOOP

Welcome to the ugBASIC sandbox!

This tool was designed to quickly test whether the code you are writing compiles correctly and determines the desired results. Since the source is compiled thanks to dedicated servers, separate from the browser you are using, some commands are not available: for example, you cannot load external files or resources by using the LOAD command. If you need to develop a program with a complete tool, we recommend installing the executables or the UGBASIC-IDE.

Unless required by applicable law or agreed to in writing, this website is given on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.