Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
unixbeard
Dec 29, 2004

There is no straight forward answer. There is some good info here http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

Also there is a scientific computing thread in SAL that might help.

Adbot
ADBOT LOVES YOU

Mniot
May 22, 2003
Not the one you know

peak debt posted:

but I'm wondering if there's a better way to do this? What's the official way to handle things like this, I'm sure this shows up all the time in science but I never formally learned these things.

Another option is to use a package that's meant for scientific computing, like MATLAB (FOSS clone is GNU Octave) or Mathematica. If you're writing something without a GUI or any library dependencies, that might actually be the easiest way to go.

Nippashish
Nov 2, 2005

Let me see you dance!

Mniot posted:

Another option is to use a package that's meant for scientific computing, like MATLAB (FOSS clone is GNU Octave) or Mathematica. If you're writing something without a GUI or any library dependencies, that might actually be the easiest way to go.

MATLAB won't help with precision issues, it uses the same doubles as the rest of us. Mathematica will handle it properly as long as you keep everything symbolic but that has other problems (like being fiercely slow). Both of these solutions have the ability to make GUIs or interface with external libraries.

By far the easiest solution is just to deal with the fact that floating point numbers aren't quite real numbers and avoid comparing them for equality.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Nippashish posted:

By far the easiest solution is just to deal with the fact that floating point numbers aren't quite real numbers and avoid comparing them for equality.

This is the real answer. I've found that in the great majority of situations you don't actually need to check floats for equality. You can almost always rewrite the algorithm in such a way that this isn't needed. The only safe check for equality with floats is if you're checking against a value you may have assigned previously.

Peak debt, what is it you're trying to do here? Checking if abs(x) < some precision is an absolute last resort.

HappyHippo fucked around with this message at 21:37 on Dec 30, 2012

peak debt
Mar 11, 2001
b& :(
Nap Ghost
I'm currently working on this http://exar.ch/files/eclipse.svg
One of the problems I was having is that the following code
code:
for (var i=0; i<Math.PI*2; i+=Math.PI/30)
{
	document.write(i * 180 / Math.PI + "<br>");
}
produces this http://exar.ch/files/math.html which isn't really supposed to happen (the loop ends one step later than it's supposed to). But you guys are right, comparing floats is quite unnecessary here, I can just make a loop that goes over an integer, then multiply the integer with a float and work with that number.

Arus
Aug 23, 2003

Hi there, I'm new to programming (particularly with questions about coding games and the like) and I've been looking around but I can't seem to find a thread for questions about Unity3d. Is there one around here I can refer to?

Scaevolus
Apr 16, 2007

peak debt posted:

produces this http://exar.ch/files/math.html which isn't really supposed to happen (the loop ends one step later than it's supposed to). But you guys are right, comparing floats is quite unnecessary here, I can just make a loop that goes over an integer, then multiply the integer with a float and work with that number.
You should avoid using floating point numbers as loop variables whenever possible, since repeatedly adding small floats is a worst case for floating point error.

N * a is much more accurate than a + a + ... + a (N times).

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

Arus posted:

Hi there, I'm new to programming (particularly with questions about coding games and the like) and I've been looking around but I can't seem to find a thread for questions about Unity3d. Is there one around here I can refer to?

You could try the Game Development Megathread here in CoC, or the Making Games Megathread over in the Games forum. Both have plenty of Unity users hanging around who could help you out, usually the CoC thread handles programming specific techy stuff while the Games thread leans toward more general game dev discussion.

coaxmetal
Oct 21, 2010

I flamed me own dad
I have never tied programming games, and it could be fun. But, I have heard a lot from games industry insiders, though most of them not engineers, and that industry sounds super lovely and not a thing I'd want to approach. I like playing games and making software that isn't games.


I still do intend to mess around with Unity or UDK or something at some point though. The thing is, I'm a programmer, not a designer, and other than making and customizing engines, a lot of games is not programming.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
If you do want to take a whack at making games just for the hell of it, the One Game A Month shindig is just kicking off and it's not too late to get on board. The general idea is that you try to make one small game a month at whatever skill level you're at, and then try out some of the other people's games so that everyone gets some feedback and suggestions on how to improve. It's a low-pressure event that mainly serves as a motivation to get off your rear end and do something instead of promising yourself that you'll try out game dev someday. If you're a programmer just sign up as a programmer and let folks know you're looking for artsy/designer types. You'd probably pick up some collaborators pretty quick. We got a thread for it here.

Also, they have 2,500+ people signed up for the thing. Holy crap.

But yeah, by all accounts the game industry sucks rear end to work in. I just like doing game dev as a hobby because it tends to present a lot of interesting problems and touches a ton of different areas of comp sci. I don't even really care about making a 'fun' game most of the time, I just like the technical challenge of trying to make a realtime physics simulator that integrates CPU/GPU/sounds/UserInput along side whatever procedural level generation, AI, or pathfinding algorithms you happen to include. You end up learning a lot on each iteration and a lot of what you learn winds up being useful for more mundane dayjob programs.

The Gripper
Sep 14, 2004
i am winner

PDP-1 posted:

But yeah, by all accounts the game industry sucks rear end to work in. I just like doing game dev as a hobby because it tends to present a lot of interesting problems and touches a ton of different areas of comp sci.
Eh, it's not really all that different from any other software industry, people just tend to have higher expectations of the actual job when entering because actually making games on your own is pretty fun.

That said, certain sectors of the games industry sucks rear end hugely if you're not in one of two positions: 1) you're the person with the idea or 2) you're given the idea and told you can do whatever the hell you want to bring it to life. The mobile games industry in particular is hosed to all hell because it's full of idea people with no concept of how to actually make games, and after a few bad experiences I've pretty much written it off as un-salvageable.

Other sectors not so much, all the console/PC work I've done has been in great environments with good structure, and generally have better leadership than "I have a million dollar iPad app idea!".

The Gripper fucked around with this message at 09:15 on Jan 1, 2013

Antinumeric
Nov 27, 2010

BoxGiraffe
So I've gotten back into programming after a year and a half working on Oracle DB's and having all of my programming knowledge eroded away. I'm working on a project with a friend in Lua and I'm still trying to get used to the whole table based programming approach and metatables.
Partly because the code called for one and partly because I wanted to get used to this language I've made a (very rough) circular array metatable:

pre:
{    __index = function (t, i)
	local idex = i % #t
	if idex == 0 then idex = #t end
	return rawget(t,idex)
	end
	,
	__newindex = function(t,i,v) 
	if type(i) == "number" then end
	local idex = i % #t
	if (i == #t + 1) then idex = #t+1 end
	if (idex == 0) then idex = #t end
	rawset(t,idex,v) end
}
I guess one question is how do I remove keys from this? I feel like I'm fumbling around in the dark with this language, it being in a style I've never really encountered. I don't quite feel like I am using Lua as I'm supposed to. Am I just being paranoid?

nielsm
Jun 1, 2009



You need to be more careful around Lua's 1-based array indexing. (I still don't get why they thought that was ever a good idea.)
Before you calculate the modulos, make sure you convert the 1-based index into a 0-based index, by subtracting one. Then convert back to a 1-based index afterwards by adding one again.
Remember that the indexing values may not be numbers. You have an empty condition in the __newindex metamethod that checks for the value being a number and then does nothing on it. You should rather check if it's a non-number and then skip the circular array logic entirely.

Since tables in Lua can't contain nil values, setting the value for an index in a table to nil is equivalent to removing the item from the table. So in your setter, check for the value being set being nil and then do whatever logic you want. (I.e. do you want to move existing indices down, or do you just leave a hole? Or maybe entirely disallow removing anything but the last element?) For that matter, how about the case of extending the array length?


Lua code:
{
  __index = function (t, i)
    if type(i) == "number" then
      i = (i-1) % #t + 1
    end
    return rawget(t, i)
  end,
  __newindex = function (t, i, v)
    if type(i) == "number" then
      i = (i-1) % #t + 1
      if v == nil then
        -- handle element removal
      end
    end
    rawset(t, i, v)
  end
}

Antinumeric
Nov 27, 2010

BoxGiraffe

nielsm posted:

You need to be more careful around Lua's 1-based array indexing. (I still don't get why they thought that was ever a good idea.)
Before you calculate the modulos, make sure you convert the 1-based index into a 0-based index, by subtracting one. Then convert back to a 1-based index afterwards by adding one again.
Remember that the indexing values may not be numbers. You have an empty condition in the __newindex metamethod that checks for the value being a number and then does nothing on it. You should rather check if it's a non-number and then skip the circular array logic entirely.

Since tables in Lua can't contain nil values, setting the value for an index in a table to nil is equivalent to removing the item from the table. So in your setter, check for the value being set being nil and then do whatever logic you want. (I.e. do you want to move existing indices down, or do you just leave a hole? Or maybe entirely disallow removing anything but the last element?) For that matter, how about the case of extending the array length?


Lua code:
{
  __index = function (t, i)
    if type(i) == "number" then
      i = (i-1) % #t + 1
    end
    return rawget(t, i)
  end,
  __newindex = function (t, i, v)
    if type(i) == "number" then
      i = (i-1) % #t + 1
      if v == nil then
        -- handle element removal
      end
    end
    rawset(t, i, v)
  end
}

Thank you for the prompt reply! The empty if in __newindex is a mistake. The end for that is supposed to be at the end of the function. Checking repl.it it seems that table.remove works correctly (it removed the index and decreases the other keys accordingly) and access works as expected afterwards. The array is only extended when you use table.insert(t,v) or try to set t[#t+1]. I'll use your advice to make it more robust however.

Some things that get me are variables being global by default, for loops being very strange compared to C, and perhaps most scarily that the # operator isn't deterministic.

nielsm
Jun 1, 2009



Antinumeric posted:

Some things that get me are variables being global by default, for loops being very strange compared to C, and perhaps most scarily that the # operator isn't deterministic.

Yeah the "global by default" thing is a bit odd. Just make a habit of using "local" to declare variables. You can even have "local" names at top level scope! In that case, they are local to the file, essentially working like private symbols in OO languages, or "static" functions in C linkage. (Local variables are also slightly faster at runtime, since any global access involves a lookup into the _G table, while local variables become direct accesses into the interpreter stack.)
Lua really has two flavours of for loops, numeric ones which act more like those in Pascal, and iterator-based which let you do all kinds of neat tricks. It's really just a different syntax.
After a bit of testing, you are right that the # operator on tables is a bit weird. If I make an empty table then #t obviously returns 0. If I add a non-numeric index it still returns 0. Likewise, if I add index 0 is keeps returning 0. If I add index 2, it still returns 0 (presumably because there is no index 1.) If I then add index 1, it returns 2 (because now there is an unbroken series of indices from 1 to 2.) However if I then clear index 1 (by setting t[1] = nil) it still returns 2. I don't know if that is changed in Lua 5.2 though, I only have 5.1 on hand to test with.

Antinumeric
Nov 27, 2010

BoxGiraffe

nielsm posted:

Yeah the "global by default" thing is a bit odd. Just make a habit of using "local" to declare variables. You can even have "local" names at top level scope! In that case, they are local to the file, essentially working like private symbols in OO languages, or "static" functions in C linkage. (Local variables are also slightly faster at runtime, since any global access involves a lookup into the _G table, while local variables become direct accesses into the interpreter stack.)
This is really handy to know, thank you!

quote:

Lua really has two flavours of for loops, numeric ones which act more like those in Pascal, and iterator-based which let you do all kinds of neat tricks. It's really just a different syntax.
Yeah but touching the i value in a numeric for loop does some crazy poo poo. Like incrementing in place or something if you try and use something like t[i+1] = x. I didn't investigate enough before going back and replacing everything with while loops.

quote:

After a bit of testing, you are right that the # operator on tables is a bit weird. If I make an empty table then #t obviously returns 0. If I add a non-numeric index it still returns 0. Likewise, if I add index 0 is keeps returning 0. If I add index 2, it still returns 0 (presumably because there is no index 1.) If I then add index 1, it returns 2 (because now there is an unbroken series of indices from 1 to 2.) However if I then clear index 1 (by setting t[1] = nil) it still returns 2. I don't know if that is changed in Lua 5.2 though, I only have 5.1 on hand to test with.

Apparently the # operator only works as expected if you have a continuous numerical index starting at 1. eg In t = {[1] = 5, [2] = 6, [9] = 7, [11] = 9} any of 2,9 and 11 are legitimate values for #t depending on what order they were added and if anything was removed. It essentially checks for the first key that has no directly following key and returns that, saving the value until that key has a following key, whereupon it recalculates it. This took a bunch of testing to find out and is quite frustrating.

nielsm
Jun 1, 2009



Antinumeric posted:

Yeah but touching the i value in a numeric for loop does some crazy poo poo. Like incrementing in place or something if you try and use something like t[i+1] = x. I didn't investigate enough before going back and replacing everything with while loops.
Uh yeah, don't modify the loop counter. C's for loops are the odd one out here.

Antinumeric posted:

Apparently the # operator only works as expected if you have a continuous numerical index starting at 1. eg In t = {[1] = 5, [2] = 6, [9] = 7, [11] = 9} any of 2,9 and 11 are legitimate values for #t depending on what order they were added and if anything was removed. It essentially checks for the first key that has no directly following key and returns that, saving the value until that key has a following key, whereupon it recalculates it. This took a bunch of testing to find out and is quite frustrating.
So in short, it makes sense as long as you use the table as a dumb array and never fill nil values into the middle. Alternatively, override the __len metamethod for the table and do your own bookkeeping.
Oh, and for that, another thing that's very handy to know is that local variables of an enclosing scope can be captured into a function definition, and are kept between executions of the function:
Lua code:
function foo()
  local x = 1
  return function ()
    local val = x
    x = x + 1
    return val
  end
end
--[[
   a = foo()
   a()
=> 1
   a()
=> 2
   a()
=> 3
   b = foo()
   b()
=> 1
   b()
=> 2
   a()
=> 4
]]
Every time you call foo it returns a new function that maintains a counter.
You can make "invisible" variables like that, for use with metatables and such.

ToxicFrog
Apr 26, 2008


nielsm posted:

So in short, it makes sense as long as you use the table as a dumb array and never fill nil values into the middle. Alternatively, override the __len metamethod for the table and do your own bookkeeping.

Two things worth noting here:
- # is only concerned with the array part, so you can freely use negative indices, floating-point indices, and non-numeric indices without affecting it. The only constraint is that you can't have gaps in the array.
- __len on tables works only in 5.2. In 5.1 it is only respected on userdata, so you need to use something like newproxy to make use of it.

raminasi
Jan 25, 2005

a last drink with no ice
I've got a pretty simple problem: given a sequence of numbers I need to find the first group of them that add up to some target number X, and if the group doesn't add up to X I need to "trim" the last one so that the total is X. For example, if the sequence is [2, 3, 5, 2, 1] and X is 12 then I want to return [2, 3, 5, 2], and if X is 11 I want to return [2, 3, 5, 1]. I'm sure this problem has a name. I'm not asking about it because it isn't easy to solve, I'm asking because I'm wondering if this is a potential opportunity to learn how to use monads for something. I've read blog posts and the wikipedia page and that sort of thing but I still haven't really grasped what they can do for me. I also don't know Haskell, which is kind of awkward. However, I'm doing this in F#, which also has monads, so I thought I'd ask.

So: Is this an appropriate problem to solve with a monad? (We'll set aside whether doing so is worth it, because like I said I consider this a learning opportunity.) The reason the question occurred to me is that "seems only possible to solve imperatively" makes me think of monads. I don't know how correct that is - this is kind of a shot in the dark. If it is appropriate, I can start chewing on it (but any pointers in the right direction would be swell). If not, I'll know not to waste my time.

nielsm
Jun 1, 2009



Eh, "given a multiset of numbers, find the subset where the sum is X", is your problem as far as I can tell. You mention "remove the last" but your example contradicts that.
A simple recursive solution would be:
1. Check if the list sums to X, if yes you have a solution.
2. If the list sums to less than X, it can't solve.
3. Create all the subsets of the list where one element is removed and recurse on them.

It seems like a pretty simple combinatorial problem and I don't see why it should be better solved imperatively. An optimisation to the above algorithm could be using an actual multiset type that supports fast checking for another multiset being a subset and memoising known non-solving subsets. With memoisation like that an imperative approach might be okay.
(E: The memoisation approach only works if the set is restricted to positive numbers.)

nielsm fucked around with this message at 02:05 on Jan 3, 2013

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I think the 1 on the end of his example is a red herring - the 1 in the output is actually the 2 that's been chopped down to fit. I think.

At least, that's all I can come up with that fits "easiest to solve imperatively".

nielsm
Jun 1, 2009



Jabor posted:

I think the 1 on the end of his example is a red herring - the 1 in the output is actually the 2 that's been chopped down to fit. I think.

At least, that's all I can come up with that fits "easiest to solve imperatively".
So the shortest prefix that adds to at least X?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


nielsm posted:

Eh, "given a multiset of numbers, find the subset where the sum is X", is your problem as far as I can tell. You mention "remove the last" but your example contradicts that.

As I'm reading the problem, the elements of the collection are ordered, and the goal is to find a prefix (or prefix-like thing where the last one is made smaller). This is not bad to do with a recursive function, and I'm not sure exactly how a monad would help here.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

nielsm posted:

So the shortest prefix that adds to at least X?

That's my reading, yes.

raminasi
Jan 25, 2005

a last drink with no ice

ultrafilter posted:

As I'm reading the problem, the elements of the collection are ordered, and the goal is to find a prefix (or prefix-like thing where the last one is made smaller). This is not bad to do with a recursive function, and I'm not sure exactly how a monad would help here.

Yeah, that's a good point. As I said, I was looking for a learning opportunity but I guess this isn't it.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

GrumpyDoctor posted:

Is this an appropriate problem to solve with a monad?

This doesn't strike me as a problem that has any particular need to involve a monad; there aren't any common monads that would seem to strongly resemble its structure.

I suppose we can treat it as a nondeterministic computation in the list monad.

code:
import Control.Monad
import Data.List
import Data.Maybe

answer :: Int -> [Int] -> Maybe [Int]
answer goal list = listToMaybe $ do
  subset <- tail $ inits list
  let subsetSum = sum subset
  guard $ subsetSum >= goal
  return $ init subset ++ [last subset - (subsetSum - goal)]
That sort of hides the work of finding the shortest prefix which satisfies your goal, but to be honest this problem probably isn't one I'd use when teaching someone about monads. The use of the list monad here is neither interesting nor particularly elegant, in my opinion.

ShoulderDaemon fucked around with this message at 05:06 on Jan 3, 2013

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
Anyone have any suggestions for organizing directory structures for external data to a project or group of projects? I recently got a new machine for work, so I thought before I start dumping everything into my home directory I try to get my data sorted properly. Generally, I put all my C code projects in ~/src/work, but for data external to the projects, I don't really know where to stuff it so that it's manageable. I have a lot of binary blobs that shouldn't be checked in to any of our repos, as well as PDF documentation and other related items, and I don't want my home directory to get polluted with useless items. I think I just need a nudge or a starting point to get me started.

nielsm
Jun 1, 2009



I prefer to have a "dev" directory under my home (called "dev" because it contains more than just source code!), then have project dircetories under that. For simple projects, the project dir may just be the source code checkout, but for things that need external documentation or such, the project dir contains several subdirs for different purposes, one of those will then be the source checkout.

Mr. Crow
May 22, 2008

Snap City mayor for life
This is kind of a stupid question, but is there such a thing as FOSS that uses modern frameworks/patterns and isn't horribly massive and/or convoluted? Need to start getting into the world of FOSS in my spare time and I'd like to look at good examples of MVC/MVVM, IOC, Hibernate etc. implemented in a real-world scenario rather than always teaching and doing it myself (don't work for a company that's using anything terribly modern unfortunately).

raminasi
Jan 25, 2005

a last drink with no ice
In IEEE floating point, if a > b then is b - a guaranteed to be less than zero? (Ignoring overflow issues, anyway. I'm not implementing a compiler, I'm just seeing if I can assume this particular thing in one particular case.)

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

GrumpyDoctor posted:

In IEEE floating point, if a > b then is b - a guaranteed to be less than zero? (Ignoring overflow issues, anyway. I'm not implementing a compiler, I'm just seeing if I can assume this particular thing in one particular case.)

Not in any compliant mode. I asked an officemate, who noted that if the processor's in flush-to-zero mode, and you subtract a positive denormal from zero, you could end up with 0; but (for reasons like this) flush-to-zero is not actually IEEE-compliant.

Henrik Zetterberg
Dec 7, 2007

I'm having some trouble recursively extracting a ton of *.7z files. Here is my directory structure:
code:
ROOT\folder 1\dir 1\1.7z
              dir 2\2.7z
              dir 3\3.7z
     folder 2\dir 1\1.7z
             \dir 2\2.7z

and so on...
I'm looking for a 7z command that I can run from ROOT that walks through all the directories and unzips the 7z files where they are.

I'm currently using:
code:
@echo off
FOR /R %%A IN (*.7z) DO (
  "c:\Program Files\7-Zip\7z.exe" x "%%A"
)
But it's extracting all the files into ROOT. Any way I can tell it to extract the files where they exist?

The Gripper
Sep 14, 2004
i am winner

Henrik Zetterberg posted:

I'm currently using:
code:
@echo off
FOR /R %%A IN (*.7z) DO (
  "c:\Program Files\7-Zip\7z.exe" x "%%A"
)
But it's extracting all the files into ROOT. Any way I can tell it to extract the files where they exist?
Assuming your batch file works, you can just pass the output path to 7z:
code:
@echo off
FOR /R %%A IN (*.7z) DO (
  "c:\Program Files\7-Zip\7z.exe" x "%%A" -o"%%~dpA"
)
%%~dpA will return the path without filename from %%A.

mjau
Aug 8, 2008

nielsm posted:

Lua code:
  __newindex = function (t, i, v)
    if type(i) == "number" then
      i = (i-1) % #t + 1
      if v == nil then
        -- handle element removal
      end
    end
    rawset(t, i, v)
  end

This won't work, unfortunately -- newindex will only be called if t[i] doesn't already exist, so v == nil can only be true if there's nothing to remove.

nielsm
Jun 1, 2009



mjau posted:

This won't work, unfortunately -- newindex will only be called if t[i] doesn't already exist, so v == nil can only be true if there's nothing to remove.

Huh. Either that changed in Lua 5.2, or Lua 5.1 wasn't documenting it properly.

mjau
Aug 8, 2008

nielsm posted:

Huh. Either that changed in Lua 5.2, or Lua 5.1 wasn't documenting it properly.

I think it's been like that since 5.0 (__index works similarly), but it's easy to miss, yeah.

nielsm
Jun 1, 2009



mjau posted:

I think it's been like that since 5.0 (__index works similarly), but it's easy to miss, yeah.

Hmm solution: Keep the actual table empty and hold the real data in a hidden table, either from an upvalue in the constructing function or in the metatable!

ToxicFrog
Apr 26, 2008


nielsm posted:

Huh. Either that changed in Lua 5.2, or Lua 5.1 wasn't documenting it properly.

It's been documented correctly since 5.0, when it was added. Metamethods in general are fallbacks, not overrides.

The usual approach is to use an empty proxy table (or newproxy() userdata) so that __index/__newindex always trigger.

Business
Feb 6, 2007

So I don't regularly do any programming but I have taken a few intro comp-sci courses in school. I've learned basic syntax and stuff in a few languages.

My question is: What language should I use for reading/manipulating text documents? I'm looking for a simple way to have a program read an input.txt and give me an output.txt. I did something like this in an algorithms class in C++, but our professor helped us through setting that up and I've since forgotten. I'm asking because I'd like the simplest way/language to get started, I don't need anything fancy at this point.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Use Python.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply