Search Results

Search found 90 results on 4 pages for 'tic'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Code Golf: Connect 4

    - by Matthieu M.
    If you don't know the Connect 4 game, follow the link :) I used to play it a lot when I was a child. At least until my little sister got bored with me winning... Anyway I was reading the Code Golf: Tic Tac Toe the other day and I thought that solving the Tic Tac Toe problem was simpler than solving the Connect 4... and wondered how much this would reflect on the number of characters a solution would yield. I thus propose a similar challenge: Find the winner The grid is given under the form of a string meant to passed as a parameter to a function. The goal of the code golf is to write the body of the function, the parameter will be b, of string type The image in the wikipedia article leads to the following representation: "....... ..RY... ..YYYR. ..RRYY. ..RYRY. .YRRRYR" (6 rows of 7 elements) but is obviously incomplete (Yellow has not won yet) There is a winner in the grid passed, no need to do error checking Remember that it might not be exactly 4 The expected output is the letter representing the winner (either R or Y) I expect perl mongers to produce the most unreadable script (along with Ook and whitespace, of course), but I am most interested in reading innovative solutions. I must admit the magic square solution for Tic Tac Toe was my personal fav and I wonder if there is a way to build a similar one with this. Well, happy Easter weekend :) Now I just have a few days to come up with a solution of my own!

    Read the article

  • Audio -- How much performance improvement can I expect from from reducing function calls by using bu

    - by morgancodes
    I'm working on an audio-intensive app for the iPhone. I'm currently calling a number of different functions for each sample I need to calculate. For example, I have an envelope class. When I calculate a sample, I do something like: sampleValue = oscilator->tic() * envelope->tic(); But I could also do something like: for(int i = 0; i < bufferLength; i++){ buffer[i] = oscilatorBuffer[i] * evelopeBuffer[i]; } I know the second will be more efficient, but don't know by how much. Are function calls expensive enough that I'd be crazy not to use buffers if I care event a tiny bit about performance?

    Read the article

  • [Python/Tkinter] Grid within a frame?

    - by Sam
    Is it possible to place a grid of buttons in Tkinter inside another frame? I'm wanting to create a tic-tac-toe like game and want to use the grid feature to put gamesquares (that will be buttons). However, I'd like to have other stuff in the GUI other than just the game board so it's not ideal to just have everything in the one grid. To illustrate: O | X | X | ---------- | O | O | X | Player 2 wins! ---------- | X | O | X | The tic tac toe board is in a grid that is made up of all buttons and the 'player 2 wins' is a label inside a frame. This is an oversimplification of what I'm trying to do so bear with me, for the way I've designed the program so far (the board is dynamically created) a grid makes the most sense.

    Read the article

  • MATLAB Magical Mystery timing behavior

    - by Jacob Lyles
    I am experiencing some very odd timing behavior from a function I wrote. If I wrap my function inside another empty container function, it gets a 3x speedup. > tic; foo(args); toc time elapsed: ~140 seconds >tic; bar(args); toc time elapsed: ~35 seconds Here's the kicker - the definition of bar(): define bar(args) foo(args) end Is there some sort of optimization that gets triggered in MATLAB for nested function calls? Should I be adding a dummy function to every function that I write?

    Read the article

  • Black screen on login page

    - by Sulliwane
    When I startup my Ubuntu 12.04 installed on a Z77 Pro4 (ASrock motherboard), crucial M4 SSD drive (sata 3), and intel i5 3570k (ivy bridge), I get this black login screen : I also hear the ubuntu login sound "tic toc" but the screen is black, and if I type in some text, only strange characters appears (as you can see on the picture). Do you have any idea ? Thanks. ps : this is an evolution of a previous problem exposed here

    Read the article

  • MiniMax function throws null pointer exception

    - by Sven
    I'm working on a school project, I have to build a tic tac toe game with the AI based on the MiniMax algorithm. The two player mode works like it should. I followed the code example on http://ethangunderson.com/blog/minimax-algorithm-in-c/. The only thing is that I get a NullPointer Exception when I run the code. And I can't wrap my finger around it. I placed a comment in the code where the exception is thrown. The recursive call is returning a null pointer, what is very strange because it can't.. When I place a breakpoint on the null return with the help of a if statement, then I see that there ARE still 2 to 3 empty places.. I probably overlooking something. Hope someone can tell me what I'm doing wrong. Here is the MiniMax code (the tic tac toe code is not important): /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package MiniMax; import Game.Block; import Game.Board; import java.util.ArrayList; public class MiniMax { public static Place getBestMove(Board gameBoard, Block.TYPE player) { Place bestPlace = null; ArrayList<Place> emptyPlaces = gameBoard.getEmptyPlaces(); Board newBoard; //loop trough all the empty places for(Place emptyPlace : emptyPlaces) { newBoard = gameBoard.clone(); newBoard.setBlock(emptyPlace.getRow(), emptyPlace.getCell(), player); //no game won and still room to move if(newBoard.getWinner() == Block.TYPE.NONE && newBoard.getEmptyPlaces().size() > 0) { //is an node (has children) Place tempPlace = getBestMove(newBoard, invertPlayer(player)); //ERROR is thrown here! tempPlace is null. emptyPlace.setScore(tempPlace.getScore()); } else { //is an leaf if(newBoard.getWinner() == Block.TYPE.NONE) { emptyPlace.setScore(0); } else if(newBoard.getWinner() == Block.TYPE.X) { emptyPlace.setScore(-1); } else if(newBoard.getWinner() == Block.TYPE.O) { emptyPlace.setScore(1); } //if this move is better then our prev move, take it! if((bestPlace == null) || (player == Block.TYPE.X && emptyPlace.getScore() < bestPlace.getScore()) || (player == Block.TYPE.O && emptyPlace.getScore() > bestPlace.getScore())) { bestPlace = emptyPlace; } } } //This should never be null, but it does.. return bestPlace; } private static Block.TYPE invertPlayer(Block.TYPE player) { if(player == Block.TYPE.X) { return Block.TYPE.O; } return Block.TYPE.X; } }

    Read the article

  • TicTac Photo and Windows 7

    - by Ben
    Hello, My wife has been creating a tictac photo album. I had to upgrade to windows 7 as i had enough of Vista so i backed up the tic tac photo file and the photos to an external hard disk and performed a fresh install of win7. Now here is the problem. TicTacPhoto says it can find the photos in the album. The locations were as follows: Vista: C:\Users\Kelly\Pictures Win 7 C:\Users\Kelly\My Pictures When i try to create a Pictures folder under Kelly it popups a message about merging the two folders and simply moves the pictures to the My Pictures folder. Does anyone know a way to make a foler called pictures so i can eliminate the file path problem and then try again with tic tac photo support to get them to fix my file. My wife is going to kill me as its our wedding album and she has spent upwards of 30hrs designing it and me upgrading to win 7 means its all my fault. She does not understand file paths etc. Im going to try and open the album file in a text editor and see if i can see anything but thought i would ask here as well. Any help appreciated.

    Read the article

  • AppKata - Enter the next level of programming exercises

    - by Ralf Westphal
    Doing CodeKatas is all the rage lately. That´s great since widely accepted exercises are important to further the art. They provide a means of communication across platforms and allow to compare results which is part of any deliberate practice. But CodeKatas suffer from their size. They are intentionally small, so they can be done again and again. Repetition helps to build habit and to dig deeper. Over time ever new nuances of the problem or one´s approach become visible. On the other hand, though, their small size limits the methods, techniques, technologies that can be applied. To improve your TDD skills doing CodeKatas might be enough. But what about other skills? Developing on a software in a team, designing larger pieces of software, iteratively releasing software… all this and more is kinda hard to train using the tiny CodeKata problems. That´s why I´d like to present here another kind of kata I call Application Kata (or just AppKata). AppKatas are larger programming problems. They require the development of “whole” applications, i.e. not just one class or method, but bunches of classes accessible through a user interface. Also AppKata problems always are split into iterations. To get the most out of them, just look at the requirements of one iteration at a time. This way you´re closer to reality where requirements evolve in unexpected ways. So if you´re looking for more of a challenge for your software development skills, check out these AppKatas – or invent your own. AppKatas are platform independent like CodeKatas. Use whatever programming language and IDE you like. Also use whatever approach to software development you like. Just be sensitive to how easy it is to evolve your code across iterations. Reflect on what went well and what not. Compare your solutions with others. Or – for even more challenge – go for the “Coding Carousel” (see below). CSV Viewer An application to view CSV files. Sounds easy, but watch out! Requirements sometimes drastically change if the customer is happy with what you delivered. Iteration 1 Iteration 2 Iteration 3 Iteration 4 Iteration 5 (to come) Questionnaire If you like GUI programming, this AppKata might be for you. It´s about an app to let people fill out questionnaires. Also this problem might be interestin for you, if you´re into DDD. Iteration 1 Iteration 2 (to come) Iteration 3 (to come) Iteration 4 (to come) Tic Tac Toe For developers who like game programming. Although Tic Tac Toe is a trivial game, this AppKata poses some interesting infrastructure challenges. The GUI, however, stays simple; leave any 3D ambitions at home ;-) Iteration 1 Iteration 2 (to come) Iteration 3 (to come) Iteration 4 (to come) Iteration 5 (to come) Coding Carousel There are many ways you can do AppKatas. Work on them alone or in a team, pitch several devs against each other in an AppKata contest – or go around in a Coding Carousel. For the Coding Carousel you need at least 3 dev teams (regardless of size). All teams work on the same iteration at the same time. But here´s the trick: After each iteration the teams swap their code. Whatever they did for iteration n will be the basis for changes another team has to apply in iteration n+1. The code is going around the teams like in a carousel. I promise you, that´s gonna be fun! :-)

    Read the article

  • 'Fixed' for loop - what is more efficient?

    - by pimvdb
    I'm creating a tic-tac-toe game, and one of the functions has to iterate through each of the 9 fields (tic-tac-toe is played on a 3x3 grid). I was wondering what is more efficient (which one is perhaps faster, or what is the preferred way of scripting in such situation) - using two for nested loops like this: for(var i=0; i<3; i++) { for(var j=0; j<3; j++) { checkField(i, j); } } or hard-coding it like this: checkField(0, 0); checkField(0, 1); checkField(0, 2); checkField(1, 0); checkField(1, 1); checkField(1, 2); checkField(2, 0); checkField(2, 1); checkField(2, 2); As there are only 9 combinations, it would be perhaps overkill to use two nested for loops, but then again this is clearer to read. The for loop, however, will increment variables and check whether i and j are smaller than 3 every time as well. In this example, the time saving at least might be negligible, but what is the preferred way of coding in this case? Thanks.

    Read the article

  • Optimizing C++ Tree Generation

    - by cam
    Hi, I'm generating a Tic-Tac-Toe game tree (9 seconds after the first move), and I'm told it should take only a few milliseconds. So I'm trying to optimize it, I ran it through CodeAnalyst and these are the top 5 calls being made (I used bitsets to represent the Tic-Tac-Toe board): std::_Iterator_base::_Orphan_me std::bitset<9::test std::_Iterator_base::_Adopt std::bitset<9::reference::operator bool std::_Iterator_base::~_Iterator_base void BuildTreeToDepth(Node &nNode, const int& nextPlayer, int depth) { if (depth > 0) { //Calculate gameboard states int evalBoard = nNode.m_board.CalculateBoardState(); bool isFinished = nNode.m_board.isFinished(); if (isFinished || (nNode.m_board.isWinner() > 0)) { nNode.m_winCount = evalBoard; } else { Ticboard tBoard = nNode.m_board; do { int validMove = tBoard.FirstValidMove(); if (validMove != -1) { Node f; Ticboard tempBoard = nNode.m_board; tempBoard.Move(validMove, nextPlayer); tBoard.Move(validMove, nextPlayer); f.m_board = tempBoard; f.m_winCount = 0; f.m_Move = validMove; int currPlay = (nextPlayer == 1 ? 2 : 1); BuildTreeToDepth(f,currPlay, depth - 1); nNode.m_winCount += f.m_board.CalculateBoardState(); nNode.m_branches.push_back(f); } else { break; } }while(true); } } } Where should I be looking to optimize it? How should I optimize these 5 calls (I don't recognize them=.

    Read the article

  • Online games programming basics

    - by Renkon
    I am writing with regard to an issue I am having nowadays. I have come up with an interesting idea of making an online game in C#, yet I do not have the knowledge to work with more than a player. Basic games like a TIC-TAC-TOE or a SNAKE were done already, and I would like to do a simple, but online, game. Would you mind giving me some tutorials or guides related to that? I would really like to learn how to work online with the client/server structure (though, I do know the basics about that structure). I look forward to reading from you. Yours faithfully, Renkon.

    Read the article

  • Single player game into Multiplayer game

    - by jeyanthinath
    I developed a Single player game in Flash (Tic Tac Toe) and in the Multiplayer mode i will be able to do both player playing on the same system with out network. I would like to extend it and make it enable to play the Multiplayer game for two player playing it online. How i can be made give me some ideas , How test the Multiplayer game playing along with different computers(I do not have internet connection in home). How I able to change the single player game into Multiplayer game , any minor changes required or I have to change the code base completely. In which way i can make it possible.

    Read the article

  • 2D Pixel/sprite game in unity? [on hold]

    - by acidzombie24
    Hi I'm an absolute newbie in unity. In the past I was told unity is terrible for 2d games so I look away after looking at it for a few days. I don't remember if this was right before unity4 came out or after. I hear unity is fairly good at 2d now. I tried googling for tutorials but I'm doing it wrong. I could not find a good tetris or tic tac toe tutorial. What assets/tutorials do I want for a 2D game? Side question is what tutorials are good if I want to make a fire emblem/advance wars type game (HUD heavy grid base game)

    Read the article

  • How is game development different from other software development?

    - by Davy8
    For a solid general purpose software developer, what specifically is different about game development, either fundamentally or just differences in degree? I've done toy games like Tic-tac-toe, Tetris, and a brute-force sudoku solver (with UI) and I'm now embarking on a mid-sized project (mid-sized for being a single developer and not having done many games) and one thing I've found with this particular project is that separation of concerns is a lot harder since everything affects state, and every object can interact with every other object in a myriad of ways. So far I've managed to keep the code reasonably clean for my satisfaction but I find that keeping clean code in non-trivial games is a lot harder than it is for my day job. The game I'm working on is turn-based and the graphics are going to be fairly simple (web-based, mostly through DOM manipulation) so real time and 3d work aren't really applicable to me, but I'd still be interested in answers regarding those if they're interesting. Mostly interested in general game logic though. P.S. Feel free to retag this, I'm not really sure what tags are applicable.

    Read the article

  • Easiest turn-base games you can think of?

    - by Edgar Miranda
    I'm planning to get into the process of programming multiplayer turn-base games. I would like to start off by making some of the simplest (yet fun) multiplayer turn-base games out there. What are some that you can provide? For example... Tic-Tac-Toe Rock-Paper-Scissors Checkers Some not so easy games... 4 in a row chess poker In terms of "ease" of implementation I'm mainly looking at logic. For example, Rock-Paper-Scissors has very simple logic, while chess has logic that is more complicated. So far I have the following: Hexagon Heroes of Might and Magic Nine Men's Morris Connect 4 21 (card game) Pen the Pig (The Dot game) Memory Match

    Read the article

  • Multiplayer Game Listen Servers: Ensuring Integrity

    - by Ankit Soni
    I'm making a simple multiplayer game of Tic Tac Toe in Python using Bridge (its an RPC service built over a message queue - RabbitMQ) and I'd like to structure it so that the client and the server are just one file. When a user runs the game, he is offered a choice to either create a game or join an existing game. So when a user creates a game, the program will create the game and also join him as a player to the game. This is basically a listen server (as opposed to a dedicated server) - a familiar concept in multiplayer games. I came across a really interesting question while trying to make this - how can I ensure that the player hosting the game doesn't tamper with it (or atleast make it difficult)? The player hosting the game has access to the array used to store the board etc., and these must be stored in the process' virtual memory, so it seems like this is impossible. On the other hand, many multiplayer games use this model for LAN games.

    Read the article

  • How important is a single-player mode in a 2-player game?

    - by Davy8
    So say you have a 2 player game, taking Chess as an example (except it's an original game with no ready-to-go AI available). Let's say there's also a social-aspect to the meta-game, so let's say it's a Chess game on Facebook where you can challenge your friends. How important is it to have a single-player mode, knowing that an AI will need to be created (I've done minimax AI for tic tac toe, but nothing too sophisticated)? Is it important enough that it should be in the initial launch of the game? Can it wait for a future iteration (knowing that being hosted on the web means the game can be updated at any time)?

    Read the article

  • How to design console application with good seperation of UI from Logic

    - by JavaSa
    Is it considered an overkill for console application to be design like MVC , MVP or N tier architecture? If not which is more common and if you can link me to simple example of it. I want to implement a tic tac toe game in console application. I have a solution which hold two projects: TicTacToeBusinessLogic (Class library project) and TicTacToeConsoleApplication (Console application project) to represent the view logic. In the TicTacToeConsoleApplication I've Program.cs class which holds the main entry point (public static void Main). Now I face a problem. I want the game to handle its own game flow so I can: Create new GameManager class (from BL) but this causing the view to directly know the BL part. So I'm a little confused how to write it in an acceptable way. Should I use delegates? Please show me a simple example.

    Read the article

  • How to create a use case diagram for board game played on PC

    - by user970696
    I'm struggling with a task as I was given to practice UML and use cases. The problem is that I should model computer version of a board game so I am unsure about a few things. obviously it does not matter if you play against the PC or another player, the actions are the same. The game is simply like tic tac toe. E.g. Actor Player ---(Place a diamond)-----include----(Check for a row)---include--(Swap players) But the game is played on the PC, so is Check for row really a use case? And the same with Swap players? Because the system would do that. On the other hand, if it was not, how could I continue?

    Read the article

  • What are the Starting Games I need to make?[Best steps for a beginner Game Developer?] [closed]

    - by Man With Steel Nerves...
    Possible Duplicate: What are good games to “earn your wings” with? Hai, I'm new to the genre "Creating Games".Previously i had done only porting.I need some suggestion's for making a game. What are the basic game logics i need to start with? - Should i write Tic-Tac-Toe game? - Actually this seem very basic to me. I'm totally confused on where to start with.I like to create big games but after starting i feel the game is too heavy to handle. Can any one list out the basic needs of a Game Play programmer? I don't mind using any platform (Flash,c++,objective-c) but i need to know what are the game logic's i need to know before i start a big game.

    Read the article

  • Can I rightfully claim this as my own project if I recieved help online?

    - by Brad Guy
    Basically I'm new to network programming in Python, so I went on a tutorial online to find out about it. Using what was taught in the tutorial (creating a socket, connecting to ports, etc), I modified the code so that I made a program where two computers can send messages to one another. If I were to apply for a job and show this to my interviewers, would the code for it technically be mine? It is fair to say that I didn't modify the code by that much; However, what if for example I modified it into something like a tic-tac-toe game, where two users play each other from different PCs, would the code then be mine? I just don't want to look like a plagiarizer hence why I ask.

    Read the article

  • How to learn to translate real world problems to code?

    - by StudioWorks
    I'm kind of a beginner to Java and OOP and I didn't quite get the whole concept of seeing a real world problem and translating it to classes and code. For example, I was reading a book on UML and at the beginning the author takes the example of a tic tac toe game and says: "In this example, it's natural to see three classes: Board, Player and Position." Then, he creates the methods in each class and explains how they relate. What I can't understand is how he thought all this. So, where should I start to learn how to see a real world problem and then "translate" it into code?

    Read the article

  • TDD Exercise Ideas

    - by Dan
    I am about to give a TDD workshop. I have the theoretical part pretty much sorted out, but I wish to avoid typical Tic-tac-toe, Currency or god forbid Calculator exercise. Any suggestions for a good TDD exercise that can be ideally finished in a couple of hours? Oh, and one exercise per answer if you can!

    Read the article

  • What are interesting ideas for experimenting with Artificial Neural Networks?

    - by Gerald Kaszuba
    I'm after a list of possible neural network implementations that one can do to learn how to use it. What other possibilities are there? Here's the list so far: Games tic-tac-toe Connect 4 Chess Go Visual recognition Character recognition (typefaces, letters, numbers, etc) Facial recognition Audio recognition Language detection Male vs female Word recognition Language detection (natural, programming)

    Read the article

  • Global Thermonuclear War [closed]

    - by Vivin Paliath
    Hey there, I'm Dr. Falken and I'm trying to make a computer program on my computer (WOPR) that simulates Global Thermonuclear War. So far I've simulated Checkers and Tic-Tac-Toe, but I've never tried to do anything on this scale. Any pointers on how I should start? Sincerely, Dr. Falken

    Read the article

< Previous Page | 1 2 3 4  | Next Page >