SmallBASIC | learn BASIC language interpreter ideal | Script Programming library
kandi X-RAY | SmallBASIC Summary
kandi X-RAY | SmallBASIC Summary
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, and graphic commands along with structured programming syntax.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SmallBASIC
SmallBASIC Key Features
SmallBASIC Examples and Code Snippets
Community Discussions
Trending Discussions on SmallBASIC
QUESTION
This code appears to throw an exception "Value was either too large or too small for a Decimal."
Somehow changing variables y1, y2, x removes an error. For example, y2 from 41 to 38.
How can I fix this?
...ANSWER
Answered 2018-Oct-07 at 22:42The problem is the SmallBasic (in version 1.2) Primitive-from-double implementation is flawed. Here is how a double is converted to a Primitive.
QUESTION
Disclaimer: noob here. I am currently studying Python in college, and code not only at school, but for fun. I am currently writing a planet generating code (which I fully wrote in smallbasic language) and working it into Python language. I am running into a slight problem, due to the inexperience I have with Python, but this may be an easy one for you guys. Please tell me how exactly I can improve this segment of code so it works in the simplest way possible. Also, I want to point out that I want the user to enter a number between 1 and 12 planets to generate. Also, if the user just presses ENTER
, enters a number outside the 1-12 number range, or enters anything other than a number, I'm wanting the program to just pick a random number. The code below works how I want it too, but it just looks sloppy and overkill...
ANSWER
Answered 2018-Apr-06 at 05:28First of all, I don't think it's working the way you expect it to because count != valid
is comparing an int
to a tuple
of strings. So that condition will always be True
(so your code will always generate a random value).
You need to convert valid
into a tuple
of ints, then use the in
operation to check if the int
value is part of the tuple
.
Like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SmallBASIC
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page