As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Very simple programming project - what to use to make it?

ReznikReznik Registered User regular
I want to make a small program, or perhaps a script or something on a page, that has 3 fields. The user makes multiple entries in each field. They hit 'go' and the script/program randomly selects one entry from each and strings them together, kind of like a Mad Lib.

I know this is like a five minute job, but I haven't done a whole lot of programming since Visual Basic/Java in high school about eight years ago. I mean, I might still be able to remember VB, but I don't even know where to get the tools (probably not free, right? Free is important).

It would be nice to get back into programming a bit. I just don't know what the friendly languages are nowadays. Java killed me in high school.

Do... Re.... Mi... Ti... La...
Do... Re... Mi... So... Fa.... Do... Re.... Do...
Forget it...

Posts

  • Options
    cmsamocmsamo Registered User regular
    edited March 2013
    You could do this in Visual Basic or download Visual C# Express - would be fairly straightforward in that environment. Last time I downloaded express it was free

    cmsamo on
    steam_sig.png
  • Options
    ReznikReznik Registered User regular
    Awesome, Express still appears to be free. Downloading now. Thanks!

    Do... Re.... Mi... Ti... La...
    Do... Re... Mi... So... Fa.... Do... Re.... Do...
    Forget it...
  • Options
    minirhyderminirhyder BerlinRegistered User regular
    Python is very friendly. I'm in your boat, I coded in Java in high school (2005), and that's where it ended.
    I decided to get back into the game and took an open course ware course in comp sci and learned some Python through that.
    There's also Codecademy, which offers a variety of languages with simple exercises to show you the way.

  • Options
    bowenbowen How you doin'? Registered User regular
    You mention page, did you want this to be online?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    ReznikReznik Registered User regular
    minirhyder: oh, that's awesome. I very, very briefly looked at Python in college (such that I don't really remember it), but I'll definitely check that out. Thanks!

    bowen: online would be nice but not a necessity. It's just a little thing that I want to distribute to a couple friends, and tossing out a link instead of sending a file would just be more convenient

    Do... Re.... Mi... Ti... La...
    Do... Re... Mi... So... Fa.... Do... Re.... Do...
    Forget it...
  • Options
    bowenbowen How you doin'? Registered User regular
    http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-web

    That might be better. You can develop apps with c# or VB.NET. Only issue is you'd need a webhost at that point.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    Jimmy KingJimmy King Registered User regular
    For something like this, if you want it as a web page, I would probably do that all in JavaScript (and of course the little bit of html you'll have to do whether it's javascript or a server side language performing the actual logic if you make it a web based thingy). Then nothing fancy is needed at all. Just a single .html file with some html and js in it which you can upload and run on any old web host.

  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    the easiest/fastest way to get running without any thinking is .NET (Visual Studio)

    Python is an honorable mention but will require more reading

  • Options
    bowenbowen How you doin'? Registered User regular
    And more configuring.

    PHP, though terrible, is also an alternative just because almost all hosts support it, compared to .NET

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    k-mapsk-maps I wish I could find the Karnaugh map for love. 2^<3Registered User regular
    edited March 2013
    Also, if this is really a throwaway type thing, then you can just use the "find/replace" feature in any text editor.

    k-maps on
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Jimmy King wrote: »
    Just a single .html file with some html and js in it which you can upload and run on any old web host.

    Or just stick it in Dropbox, for a ghetto pseudohost solution.

    I was going to say javascript too, but it's a great opportunity to learn some stuff. I had a random brainfart for a small coding project, and just because I could and had the opportunity to learn new stuff, I chose to write it in Ruby based on Sinatra and deployed to Heroku.

  • Options
    ReznikReznik Registered User regular
    So I managed to make a thing that works in C#!

    It's not very pretty, but it does what it's supposed to. After staring blankly at the screen for about a half hour, some programming concepts started coming back to me so that's a good sign. I'm going to keep adding to it as I figure things out.

    So I'm thinking above my skill level right now, but my down-the-road idea is this: the program itself is basically a writing prompt generator. At the moment the users input multiple entries for character name, an action, and a location. Then the program strings them together. But I think it would be cool if the users could submit the action and location entries to a database, and they could download new entries from that database, so there's a lot more options to choose from.

    I know obviously I need some kind of web host, but aside from that, how difficult would it be to implement that idea?

    Do... Re.... Mi... Ti... La...
    Do... Re... Mi... So... Fa.... Do... Re.... Do...
    Forget it...
  • Options
    TofystedethTofystedeth Registered User regular
    At it's simplest you basically be taking in text input, sticking it in a list of strings of the same type (name, action, location) then dumping it all to a file or something, with some structure to show what category each word is in when it is read back out.
    If you want to do actual DB stuff, it will be different, but that aspect's not something I've really worked with.

    steam_sig.png
  • Options
    TehSlothTehSloth Hit Or Miss I Guess They Never Miss, HuhRegistered User regular
    edited March 2013
    It may be a bit ambitious but if you want to go to the web then I'd look into Ruby and then Heroku deployment. Basic Ruby is REALLY easy to use and you could knock out a mad lib type thing extremely quickly. For example, not sure how complex your mad libs are but here's what it might look like in Ruby.
    puts "What is the character's name"
    charname = gets
    puts "What does the character do"
    charaction = gets
    puts "Where does the character do it"
    charlocation = gets
    puts "#{charname.chomp} #{charaction.chomp} #{charlocation.chomp}"
    pause = gets
    

    You could expand by setting up a db with a simple two column table, one of words and the other describing it's part of speech. There's lots of great free DBs you can use yourself, you'll just have to learn some simple SQL, and trust me, for stuff like this it is really simple. SQLite and postgres are good options, the latter mostly because if you decide to make a web app on heroku they'll host a small postgres DB for you for free. If you end up wanting to put it on the web you should look into Sinatra for ruby, it's super easy as long as what you're doing is really simple.

    TehSloth on
    FC: 1993-7778-8872 PSN: TehSloth Xbox: SlothTeh
    twitch.tv/tehsloth
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Yeah, I'm a big fan of Ruby, and as mentioned I'm doing a small learning experiment with Sinatra on Heroku right now. Feel free to ask me stuff in the programming thread in the tech tavern if you go that route.

Sign In or Register to comment.