Jump to content

gauvinic

Member
  • Posts

    135
  • Joined

  • Last visited

Everything posted by gauvinic

  1. I'm not gonna give you any code verbatim, because that's pointless and you won't learn. What I will do is highlight things that you appear to not grasp and suggest how to actually go about it. If I sound rude at all, I apologize, that's not my intent. Now on to the problem. From the little Arduino work I've done (I mainly use Xylinx/ Quartus/ Keil/ CodeWarrior/ Atmel Studio), I know that an arduino "sketch" needs a minimum of two functions: a setup function and a loop function. It appears that you have declared the setup function, but it does nothing. Try fixing the scope operators, {}, so that what you want setup() to do is contained within it's scope. When you call pinMode(), since it is a function/ method call, you need to indicate the end of the call with a ;. You need to do this each time you call the function, or any other, for that matter. Readline does not exist, at least according to a quick google search. Try using something else. Also, you would use it as a function. while (number < 255({ //if (money)<255// the computer will generate a random number Serial.println("guess the number") }; ^Not at all sure what this is for. However, for while loops, try to follow this structure: while(condition) { // Do stuff myFunc(); } This is also a correct use of a while loop, if you want to wait until some condition has been met. I've seen it used a few times in your code, and what I saw seemed fine. while(condition); I don't believe you are using digitalWrite() correctly. Check the input parameters online and try to match that. You may have to make multiple function calls instead of just one. You also have random () in the code. Variable "guess" is used but never declared/ instantiated. Be consistent. I believe you meant to put "answer" here, but I could be wrong. The way your digitalWrite is written, it looks like you intend to blink the LEDs all at once. However, in order to blink the LEDs, you first have to turn them on (pins HIGH or LOW depends on your circuit), wait for some delay, then turn them off. So if you want them to blink in succession, you will have to write this for each LED seperately, instead of turning them all on, calling delay once, then turning them all of.
  2. First, sorry to OP for this pointless little interaction between babbaj and me, but this is my last post. No, not in the clip I posted a link for. I could find something relating to the catholic church that links it to porn, but I'm pretty sure that's against CoC. Anyway, the point was what she said, not that she's a... I don't really know what she is. Pagan wolf deity?
  3. Besides all the logical, biological reasons, here's a thought. https://youtu.be/yThuRcpRs1Q?t=17s
  4. I had an issue with a certain part of the world where the screen would freeze. Had to navigate using the minimap, which still worked. If I remember right, it was an update that Ubisoft pushed. To fix it, I had to turn off volumetric fog. Does it happen regardless of location?
  5. Should I be worried about the 4:2:0 subsampling? Everything else seems fine.
  6. I'm a Computer Engineering major in America, but I assume its similar to Canada's. I only say that because I'm aware that not all countries call the same field of study the exact same thing. Honestly, it opens up a wide range of jobs. At least at my school, Computer Engineering is essentially a hybrid of Software Engineering and Electrical Engineering. You should technically have the skillset required to get a low level Electrical Engineer job, and if you take more CS courses as electives, you can do a broad range of programming jobs, including low level processor coding/ drivers, high level coding (user end applications/ data storage/ manipulation), and FPGA programming. You should also be able to design logic chips. As many as you're willing to commit to. At least for most. There's plenty of startups, and the mentality of startups has to be incentive based. Older companies can have more of a seniority based system, but from what I've seen, you'll be fine if you work hard at it. Again, this is flexible based on the company, but software companies seem to be moving back to the mentality they had around the 70's/ 80's. You can expect to not work at a cubicle, but instead work in an open environment where you can freely go amongst team members, gather around to talk about plans, etc. In fact, that's how it is at my current internship. As for hours, it can be light one week, but be ready and able to work nights if necessary. Most (if not all) full time software engineering jobs are salaried. I cannot speak towards hardware engineering on this. You can learn to solder and build simple working circuits. There are plenty of videos online for this, but one channel I find useful for circuits/ hardware is: EEVBlog You can also learn how to program microcontrollers like the arduino, but I'd stay away from Arduino's libraries. Companies are looking for people who can write their own code from scratch. Often times, its illegal to use these libraries in a product. While it is possible to get an arduino board and not use it's IDE/ libraries, you can also get something like the Freedom KL25Z, and use Keil/ CodeWarrior to program it. The board has an ARM Cortex M0+ on it, as well as an accelerometer, RGB LED (Common Anode), and a Touch sensor, and its only $13. You can even practice your soldering skills if you get headers to put on it. ICs, breadboards, Microcontrollers in general, circuit components, oscilloscopes, multimeters, compilers, etc. It's good that you want to check out what you're getting into. I'm the only one from my initial college friend group still in Computer Engineering. Its not the easiest major, by any means. That being said, if you love computers in general, it is a worthwhile major in my opinion. Its really interesting/ fun learning about how things like screens, user input, various sensors work and being able to control them yourself. To me, the most painful part of Comp. Eng. is FPGA programming. I hate Verilog. The concept is easy enough, but Verilog requires that you create a circuit that is close enough to one of their predefined templates. Even if the circuit is physically possible on the chip, your code may not synthesize.
  7. Make snake for the console window.
  8. Just a console version of Conway's Game of Life. I wrote it to get my feet wet with C#, because the place I'm interning at uses C#. using System;using System.Collections;using System.Threading;namespace GameOfLife { class Program { static void Main() { bool reset = false, exit = false; // loop conditionals BitArray world = new BitArray(24 * 75), nextW = new BitArray(24 * 75); // storage for live/dead cells Random random = new Random(); // used in initializing world randomly Console.WriteLine("Welcome to Conway's Game of Life!\n\nControls:\n\n Reset World:\t\tR\n\n Exit Application:\t\tEsc"); Console.WriteLine("\n\n\nPress Enter to Begin!"); // greeting/ instructions Console.ReadLine(); // Pause to keep instructions on screen until user is ready while (!exit) { // Esc hasn't been pressed for (int i = 0; i < 24; i++) { for (int j = 0; j < 75; j++) { if (random.Next(0, 5) == 0) world.Set(i*75 + j, true); else world.Set(i * 75 + j, false); } } // One in Five chance of live cell printWorld(world); // display initial generation Thread.Sleep(100); // wait 100 mS while(!reset && !exit) { // neither exit nor reset flag has been raised for (int i = 0; i < 24; i++) { for (int j = 0; j < 75; j++) { if ((world.Get(i * 75 + j) && (getNeighbors(world, i, j) == 2)) || (getNeighbors(world, i, j) == 3)) nextW.Set(i * 75 + j, true); else nextW.Set(i * 75 + j, false); } } // If Neighbors N = 2 and cell is currently living, cell lives. Else if N = 3, cell lives. Else cell dies. for (int i = 0; i < 24; i++) { for (int j = 0; j < 75; j++) world.Set(i*75 + j, nextW.Get(i*75 + j)); } // pass new generation values into displayed array (will become old generation) printWorld(world); // display new generation Thread.Sleep(100); // wait 100 mS if (Console.KeyAvailable) { var key = Console.ReadKey(true).Key; if (key == ConsoleKey.R) reset = true; else if (key == ConsoleKey.Escape) exit = true; } // if key pressed, check to see if its a key we care about, and update flags accordingly } reset = false; // in case r was pressed, resets the reset flag to false } } static void printWorld(BitArray world) { string newS = ""; // used because old image persisted without first writing to string for (int i = 0; i < 24; i++) { for (int j = 0; j < 75; j++) { if (world.Get(i*75 + j)) newS += "#"; else newS += " "; } newS += "\n"; } Console.Clear(); // used for same reason as newS Console.Write(newS); // update console image } static int getNeighbors(BitArray world, int i, int j) { // i and j assumed to be within bounds. OK for self-contained program and functions, not for library/ group code. int neighbors = 0; if (i + 1 < 24) { // top row y val ok if ((j + 1 < 75) && world.Get((i+1)*75 + j+1)) neighbors++; if (world.Get((i+1)*75 + j)) neighbors++; if ((j - 1 >= 0) && world.Get((i+1)*75 + j-1)) neighbors++; } if ((j + 1 < 75) && world.Get(i*75 + j+1)) neighbors++; if ((j - 1 >= 0) && world.Get(i*75 + j-1)) neighbors++; if (i - 1 >= 0) { // bottom row y val ok if ((j + 1 < 75) && world.Get((i-1)*75 + j+1)) neighbors++; if (world.Get((i-1)*75 + j)) neighbors++; if ((j - 1 >= 0) && world.Get((i-1)*75 + j-1)) neighbors++; } return neighbors; // each neighbor checked, returns number of living cells } }}
  9. 1) Skyrim 2) Minecraft 3) Deus Ex: Human Revolution 4) Bastion 5) The Binding of Isaac Thanks to OP and good luck to everyone!
  10. SSB4, Bastion, and MVP Baseball 2005
  11. I live in WI, so I'm tempted to do this for next winter.
  12. https://www.spotify-yearinmusic.com/ I'm slow... Also, I listened to music for 57,040 minutes. Wow...
  13. Burn. Pain would be over shortly, then, assuming I still maintain control of my movements, I'd run around like a crazy mofo.
  14. 5 episodes in and I have to say, I really like it. Gives me something to do when I'm not doing homework or working (which is during normal waking hours for most people, including my friends).
  15. Probably not quite what your listening to right now (I like a wide variety), but in more of a rap/ hip hop vibe (rap isn't a genre technically, btw), I'd recommend checking out Strange Music's artists, Nas, Xzibit, Bliss n Eso. Really into Bliss n Eso right now. Favorite songs are I Am Somebody, Addicted, Life's Midnight, Home is Where the Heart Is, Next Frontier, and Animal Kingdom.
  16. Program it to take over the functions of the processor that controls your oven/stove, and replace all the knobs/buttons with capacitive touch sensors. Also, hook up a wifi antenna to it so that you can control your oven from your phone, and have your oven notify you when your meal is ready.
  17. @fizzlesticks @wolfsinner Thanks. I figured it was that, but I've never seen this specific take on problems relating to permutations. I have researched A* before, because of Problem A (http://icpc.baylor.edu/download/worldfinals/problems/icpc2014.pdf). Haven't implemented it yet, but I did find that a heuristic based on Disjoint Pattern Databases can be significantly faster than the Manhattan Distance. Probably won't get to it any time soon, though, because I have to focus on my Digital System Design project (a singing Tesla Coil!!!). Hopefully will have some reasonable amount of time to spend on these next week, or maybe during the ACM meeting this week if its the same overly simple stuff again (we have alot of freshman).
  18. Are there any specific rules the steps have to follow? I've seen some problems relatively similar, but each of them had specific rules. Or maybe I'm just missing it because I'm on mobile. Edit: My guess is that you can only swap the 0 element with any adjacent element in the two dimensional array.
  19. Pretty much because I went to a Porter Robinson concert last night, this is my favorite song on his new album, and I think it (mostly) goes very well with ZnT.
×