Hot answers tagged

12 votes

Tips for golfing in QBasic

Know your looping constructs QBasic has several looping constructs: FOR ... NEXT, WHILE ... WEND, and ...
DLosc's user avatar
  • 38.4k
11 votes

Tips for golfing in SmileBASIC

Replace string!="" with string>"" SB allows you to do greater/less comparisons on strings, based on their codepoints. ...
snail_'s user avatar
  • 2,642
8 votes

Tips for golfing in VBA

Write and run the VBA code in the Immediate Window The Immediate Window evaluates any valid VBA executable statement. Simply enter a statement in the Immediate Window as you would in the code editor. ...
Anastasiya-Romanova 秀's user avatar
8 votes

Tips for golfing in QBasic

Divisibility testing In programs that require you to test whether one integer is divisible by another, the obvious way is to use MOD: ...
DLosc's user avatar
  • 38.4k
7 votes

Tips for golfing in QBasic

Scanner abuse As in a lot of languages, knowing which characters can and can't be removed is important. Any space next to a symbol can be removed: ...
DLosc's user avatar
  • 38.4k
6 votes

Tips for golfing in QBasic

Use shortcuts for PRINT and REM You can use ? instead of ...
Uriel's user avatar
  • 13.1k
6 votes

Tips for golfing in SmileBASIC

Using ?, ., @, and unclosed strings Many dialects of BASIC support ...
12Me21's user avatar
  • 6,671
6 votes

Tips for golfing in VBA

Evaluate() And [] As has been pointed out previously, hard-coded range calls can be reduced using the square brackets ...
Greedo's user avatar
  • 287
6 votes

Tips for golfing in VBA

Combine Next Statements Next:Next:Next May be condensed down to Next k,j,i where the ...
Taylor Raine's user avatar
  • 8,320
5 votes

Tips for golfing in VBA

Prepare For Pixel Art Pixel art is by far one of Excel's strongest areas, as there is no need to construct a canvas, as it is already there for you - all you need to do is make some small ...
Taylor Raine's user avatar
  • 8,320
5 votes

Tips for golfing in QBasic

Know your input methods QBasic has several ways to get user keyboard input: INPUT, LINE INPUT, ...
DLosc's user avatar
  • 38.4k
4 votes

Tips for golfing in TI-BASIC

Which list variables to use? When using lists, avoid the default lists L₁ through L₆ in favor of named lists with one-letter ...
Misha Lavrov's user avatar
  • 5,247
4 votes

Tips for golfing in QBasic

PRINT (?) has some quirks Numbers are printed with a leading and trailing space. Printing adds a linebreak. This behaviour can ...
steenbergh's user avatar
  • 8,094
4 votes

Tips for golfing in QBasic

Combine Next Statements Next:Next:Next May be condensed down to Next k,j,i where the ...
Taylor Raine's user avatar
  • 8,320
3 votes

Tips for golfing in SmileBASIC

Use string indexing instead of MID$ The MID$ function is a common function in many BASICs to get a substring from somewhere in ...
snail_'s user avatar
  • 2,642
3 votes

Tips for golfing in VBA

Remove Spaces VBA will auto-format to add a lot of spacing that it doesn't actually need. There' an answer on meta that makes a lot of sense to me why we can discount bytes added by auto-formatting. ...
Engineer Toast's user avatar
3 votes

Tips for golfing in VBA

Reduce Range("A1") and Like Calls Range("A1").Value(17 Bytes) and the simpler Range("A1")...
Taylor Raine's user avatar
  • 8,320
3 votes

Tips for golfing in VBA

STDIN and STDOUT Inputting to Subroutines and Functions via input variables ...
Taylor Raine's user avatar
  • 8,320
3 votes

Tips for golfing in QBasic

In QBasic, it is customary to use the DIM statement to create variables, giving them a name and a type. However, this isn't mandatory, QBasic can also derive a type ...
steenbergh's user avatar
  • 8,094
3 votes

Tips for golfing in QBasic

LOCATE can be really powerful The LOCATE statement allows you to place the cursor anywhere on the screen (within the usual 80x40 character space limits) and print ...
steenbergh's user avatar
  • 8,094
3 votes

Tips for golfing in QBasic

Shortening IF statements IF statements are rather expensive, and golfing them down can save a lot of bytes. Consider the ...
DLosc's user avatar
  • 38.4k
3 votes

Tips for golfing in QBasic

Sometimes, you should avoid arrays Arrays in QBasic, when instantiated without DIM have only 11 slots. If a challenge requires more than 11 slots (or N slots, where ...
steenbergh's user avatar
  • 8,094
2 votes

Tips for golfing in VBA

Reduce Debug.Print and Print calls Debug.Print [some value] (12 Bytes; note the trailing ...
Taylor Raine's user avatar
  • 8,320
2 votes

Tips for golfing in VBA

Infinite Loops Consider replacing Do While a<b '... Loop or Do Until a=b '... Loop with the antiquated but lower byte ...
Greedo's user avatar
  • 287
2 votes

Tips for golfing in VBA

Use Spc(n) over Space(n), [Rept(" ",n)] or ...
Taylor Raine's user avatar
  • 8,320
2 votes

Tips for golfing in VBA

Address Sheets By Name Instead of Addressing a WorkSheet object by calling Application.ActiveSheet '' Or ActiveSheet One ...
Taylor Raine's user avatar
  • 8,320
2 votes

Tips for golfing in VBA

Use a helper Sub to Print If the code requires using more than six Debug.? statements you ...
Ben's user avatar
  • 231
2 votes

Tips for golfing in VBA

Quick Note on Formatting Because StackExchange uses Markdown and Prettify.js it is possible to add a language flag to your coding answers, which generally makes them look more professional. While I ...
Taylor Raine's user avatar
  • 8,320
2 votes

Tips for golfing in SmileBASIC

Use the syntax highlighter! SmileBASIC's code editor has a built in syntax highlighter, that can be used to determine whether code will work or not. For example, if you try to do ...
12Me21's user avatar
  • 6,671
2 votes

Tips for golfing in SmileBASIC

When to use : (or not) The : character is used as a statement-breaker in SB. Basically, you use it to stack statements on one ...
snail_'s user avatar
  • 2,642

Only top scored, non community-wiki answers of a minimum length are eligible