# Tips for Golfing in Symja

Symja is a "computer algebra language & Java symbolic math library for Android NCalc calculator". It's a fun little language, so I'm wondering if y'all have any tips for golfing in Symja.

As per usual, "remove comments", etc, isn't really an answer. It turns out that there is no comment system in Symja, so "remove comments" isn't an answer. :P

• remove comments Mar 21, 2020 at 23:12
• @QuoraExpert I would, but there are no comments to remove in the first place! :P Mar 21, 2020 at 23:19
• I should use this language more, that way I don't have to make up any excuses for never commenting my code :D Mar 22, 2020 at 0:37
• LOL! NICE EDIT!! Mar 22, 2020 at 1:06
• This language is basically just Mathematica but uses round brackets instead of square ones, so Tips for golfing in Mathematica would be helpful. Apr 13, 2022 at 2:01

# Don't Use Print...Use the Formatted Output

Here's an example fizzbuzz:

For(i=1,i<101,i++,s="";If(Mod(i,5)==0,s=s<>"Fizz");If(Mod(i,3)==0,s=s<>"Buzz");If(Mod(i,5)*Mod(i,3)!=0,s=s<>ToString(i));Print(s))


Now, this is alright, but it can be improved:

For(i=1,i<101,i++,If(Mod(i,5)==0,s=s<>"Fizz");If(Mod(i,3)==0,s=s<>"Buzz");If(Mod(i,5)*Mod(i,3)!=0,s=s<>ToString(i));s=s<>"\n");s


Sure, it's only two bytes shorter, but hey, it's two bytes shorter.

Just put all the output into a string and tack a ;<variable_name> onto the end and you'll have a shorter program (usually).