We'd like to remind Forumites to please avoid political debate on the Forum. This is to keep it a safe and useful space for MoneySaving discussions. Threads that are - or become - political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
How easy to write a simple app?
daveyjp
Posts: 13,015 Forumite
in Techie Stuff
My computer programming knowledge left me once I moved on from a ZX81 and BASIC prgrammes no more than 16k in length and that was a long time ago!
I have devised on paper a 'scenario generator' and the maths behind it is very simple. In BASIC it would be an 'if' 'then' approach
There are four stages, each requiring a random choice to be made from various selections at each stage.
The programme chooses a random number and each number is associated with an outcome.
The idea is nothing to do with coffee, but as an example.
I have devised on paper a 'scenario generator' and the maths behind it is very simple. In BASIC it would be an 'if' 'then' approach
There are four stages, each requiring a random choice to be made from various selections at each stage.
The programme chooses a random number and each number is associated with an outcome.
The idea is nothing to do with coffee, but as an example.
First number generated between 1 and 6
1 is cortado, 2 cappucino, 3 espresso, 4 latte, 5 americano, 6 filter
It then repeats but the choice is two. 1 sugar 2 no sugar
Third choice 1-4 semi skimmed, full fat, oat, almond milk
then a final selection for say syrup. Random number between 1-4 again chocolate, caramel, hazlenut, almond
So on a single 'generate' button you would be presented with a selection from each decision
E.g Cappucino, sugar, oat milk, chocolate syrup.
Any online resources to help me in my task to write a simple programme to generate an app for the above task?
It then repeats but the choice is two. 1 sugar 2 no sugar
Third choice 1-4 semi skimmed, full fat, oat, almond milk
then a final selection for say syrup. Random number between 1-4 again chocolate, caramel, hazlenut, almond
So on a single 'generate' button you would be presented with a selection from each decision
E.g Cappucino, sugar, oat milk, chocolate syrup.
Any online resources to help me in my task to write a simple programme to generate an app for the above task?
0
Comments
-
A lot depends on how you want to run your app, who you want to be able to run it and whether you want to develop and host it for free.
If it were me, I think I'd start it as a web app - an HTML web page with your automation coded in Javascript. That's all pretty easy, it's free to run it in your own browser and only you will be accessing it in the first instance.
If you later wanted to put it online you could do that easily, possibly at a cost for hosting and a domain name.
There's a well-regarded resource for HTML and Javascript here: https://www.w3schools.com/1 -
If you've a iPhone or IPad you could do this using Shortcuts .
eg https://support.apple.com/en-gb/guide/shortcuts/apdd02c2780c/ios0 -
daveyjp said:My computer programming knowledge left me once I moved on from a ZX81 and BASIC prgrammes no more than 16k in length and that was a long time ago!
I have devised on paper a 'scenario generator' and the maths behind it is very simple. In BASIC it would be an 'if' 'then' approach
There are four stages, each requiring a random choice to be made from various selections at each stage.
The programme chooses a random number and each number is associated with an outcome.
The idea is nothing to do with coffee, but as an example.First number generated between 1 and 61 is cortado, 2 cappucino, 3 espresso, 4 latte, 5 americano, 6 filter
It then repeats but the choice is two. 1 sugar 2 no sugar
Third choice 1-4 semi skimmed, full fat, oat, almond milk
then a final selection for say syrup. Random number between 1-4 again chocolate, caramel, hazlenut, almond
So on a single 'generate' button you would be presented with a selection from each decision
E.g Cappucino, sugar, oat milk, chocolate syrup.
Any online resources to help me in my task to write a simple programme to generate an app for the above task?
Many (basic) apps are nothing more than a website put into an app wrapper but all the content is still just standard HTML etc. Makes it easy to port on platforms but you'll never write a great golf simulator that way.
Almost all programming languages use IF statements, some have more squiggly brackets than others but not that far removed from Basic0 -
If you have any recall of your Basic programming you could download and install the free version of Visual Studio and do it in that. It’s free, it’ll hold your hand and fill in the syntax as you type (Intellisense) and will create an app on the PC you’re using. It’s up to you how complex you make it, which language you use, and how you disseminate it should you choose to.Sounds like a fun little exercise tbh. Good luck.0
-
Username03725 said:If you have any recall of your Basic programming you could download and install the free version of Visual Studio and do it in that. It’s free, it’ll hold your hand and fill in the syntax as you type (Intellisense) and will create an app on the PC you’re using. It’s up to you how complex you make it, which language you use, and how you disseminate it should you choose to.Sounds like a fun little exercise tbh. Good luck.0
-
UncleZen said:Username03725 said:If you have any recall of your Basic programming you could download and install the free version of Visual Studio and do it in that. It’s free, it’ll hold your hand and fill in the syntax as you type (Intellisense) and will create an app on the PC you’re using. It’s up to you how complex you make it, which language you use, and how you disseminate it should you choose to.Sounds like a fun little exercise tbh. Good luck.Visual Studio is wrapped around the .NET Framework and has been for a long time. That makes the syntax look more complicated and generally ties you into that infrastructure.The Visual Basic for Applications that you get in Office is probably as close to the original Basic vision language wise as you can get, though there are a few other variations out there that use Basic.Of course in the days of the ZX81/Spectrum/Amstrad/Commodore, you had things like 10 Print "Hello World" 20 GOTO 10. Line numbers haven't been a thing since the 90s though.0
-
UncleZen said:Username03725 said:If you have any recall of your Basic programming you could download and install the free version of Visual Studio and do it in that. It’s free, it’ll hold your hand and fill in the syntax as you type (Intellisense) and will create an app on the PC you’re using. It’s up to you how complex you make it, which language you use, and how you disseminate it should you choose to.Sounds like a fun little exercise tbh. Good luck.My original point was that anyone who recalls BASIC programming will be aware of programming basics - variable declaration, iteration, conditional statements. VB.Net isn’t that different, C# is more elegant but for a beginner just pick one and go with it. Mainly though you’re not on your own the way you were typing in BASIC code from a magazine years ago. There’s a world of support, instructional guidance, videos and techie web sites that’ll get you going these days with a Hello World app, from which our man here can create what he wants.1
-
I recommend looking at learning python. You can do what you want in 6 lines of code. You get a different random answer each time you run it. If you want a gui with a submit button, it'll only be a few more lines of code using the tkinter module
<div>import random</div><div><br></div><div>coffee = random.choice(["cortado", "cappucino", "espresso", "latte", "americano", "filter"])</div><div>sugar = random.choice(["sugar", "no Sugar"])</div><div>milk = random.choice(["semi skimmed", "full fat", "oat", "almond milk"])</div><div>syrup = random.choice(["chocolate", "caramel", "hazlenut", "almond"])</div><div><br></div><div>print(f"{coffee}, {sugar}, {milk}, {syrup}.")<br></div>
1
Categories
- All Categories
- 347.1K Banking & Borrowing
- 251.6K Reduce Debt & Boost Income
- 451.7K Spending & Discounts
- 239.3K Work, Benefits & Business
- 615.2K Mortgages, Homes & Bills
- 175K Life & Family
- 252.7K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 15.1K Coronavirus Support Boards