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
daveyjp Posts: 13,015 Forumite
Part of the Furniture 10,000 Posts Name Dropper
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 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?

Comments

  • Cornucopia
    Cornucopia Posts: 16,318 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 29 June 2023 at 6:50PM
    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/
  • PHK
    PHK Posts: 1,950 Forumite
    Seventh Anniversary 1,000 Posts Photogenic Name Dropper
    If you've a iPhone or IPad you could do this using  Shortcuts .

    eg https://support.apple.com/en-gb/guide/shortcuts/apdd02c2780c/ios
  • DullGreyGuy
    DullGreyGuy Posts: 14,638 Forumite
    10,000 Posts Second Anniversary Name Dropper
    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 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?
    There are multiple ways to create apps and what works best really depends on what functionality you want, what devices to offer it on etc.

    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 Basic 
  • 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.
  • UncleZen
    UncleZen Posts: 842 Forumite
    Part of the Furniture 500 Posts Name Dropper Photogenic
    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.
    I think anyone with zx81/basic knowledge would have their mind blown to pieces with visual studio, just setting it up is enough to give you a lifetime headache unless you know what you're doing IMO.
  • Neil_Jones
    Neil_Jones Posts: 9,308 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    UncleZen 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.
    I think anyone with zx81/basic knowledge would have their mind blown to pieces with visual studio, just setting it up is enough to give you a lifetime headache unless you know what you're doing IMO.

    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.
  • Username03725
    Username03725 Posts: 508 Forumite
    Third Anniversary 100 Posts Name Dropper
    UncleZen 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.
    I think anyone with zx81/basic knowledge would have their mind blown to pieces with visual studio, just setting it up is enough to give you a lifetime headache unless you know what you're doing IMO.
    It’s a straightforward Windows install, it was last time I did it a year or so ago. It offers a lot of additional options for data tools etc but the chances are if you don’t know what they are you can safely ignore them and go with the basics - VB.Net, C#, C++ maybe. 

    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.
  • mksysb
    mksysb Posts: 378 Forumite
    Seventh Anniversary 100 Posts Photogenic Name Dropper
    edited 10 July 2023 at 5:39PM
    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>



Meet your Ambassadors

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

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.