Friday, March 29, 2019

Tech Book Face Off: Seven Languages In Seven Weeks Vs. Seven More Languages In Seven Weeks

Yes, that's right. I learned fourteen programming languages in as many weeks. Actually, it was more like four weeks, but I just couldn't put these books down. I had wanted to work through them ever since I had read Seven Databases in Seven Weeks a few years ago and loved it. Now I finally made the time to read them, and had a blast the whole time. I shouldn't have waited so long to crack these books open. I started off with Seven Languages in Seven Weeks by Bruce Tate, and then quickly moved on to consuming his follow on book, Seven More Languages in Seven Weeks, co-authored with Ian Dees, Frederic Daoud, and Jack Moffitt. It's not as hard as it would seem to learn about so many languages in such a short amount of time, as long as you already have a few under your belt, because really the hardest programming language to learn is the second one. After you overcome the confusion of holding two different languages in your head, it becomes much easier to add another and another and another. The differences get slotted into your brain more readily, and the major hurdle becomes figuring out how to use the new paradigms and features that you run up against. Let's see how these books handled presenting all of these different languages and smoothing the shock of moving from one language to another in rapid succession.

Seven Languages in Seven Weeks front coverVS.Seven More Languages in Seven Weeks front cover

Seven Languages in Seven Weeks


With such an ambitious goal crammed into 300 pages, Bruce Tate certainly had to take some shortcuts with this book. Those cuts included any installation instructions beyond a link and a version number, detailed descriptions of the literals, operators, and control structures of each language, and extended tours of the standard libraries. There's just no time for that crap, and it's expected that if you're reading a book like this, you've been around the block a few times and can either figure out how to write basic lines of code in any language on your own or you know how to google it. There are more important things to cover for these languages.

Each of the seven languages gets its own chapter, split into three days. The first day introduces the basics of a language with some quick examples and an interview with the language's creator. The second day starts covering the unique aspects of the language and gets further into the programming model. The third day usually gets into the concurrency aspects of the language, if it has special constructs for concurrency, or some other special aspect of the language, like metaprogramming in Ruby or monads in Haskell. At the end of each day Tate gives some good exercises to help solidify the ideas presented for that day and lead into the next day.

The discussions were great—concise and to the point while also being clear and extremely helpful for understanding the difficult parts of each language. To make the material even better, all throughout the book the languages are compared with popular movies. It was entertaining to see Tate go from Ferris Bueller's Day Off to The Princess Bride to The Matrix without missing a beat. I never knew which movie reference would pop up next, and it made me keep plowing through for more. It was a wild ride. So what were the seven languages covered?

Ruby
First off was a language I already knew pretty well. Ruby is a beautiful language that achieves its goal of making programmers happy. It's probably my favorite language of all the ones I (now) know. It's a straight-up object-oriented language where everything is an object, including literals and operators. Tate covers duck typing, code blocks, mixins, the almightly Enumerable module, and of course metaprogramming. In three short days you can really get a sense of what makes Ruby a great language for programmers.

Io
Io is a prototypical language, meaning everything is an object, but there are no classes. Objects are derived from other objects and then changed by adding parameters and functions to slots in the object. It's quite a small language without many extra features or syntax, but it is definitely a flexible language. The programmer has complete freedom to change how objects behave by changing their base functions. It took me a little while to wrap my head around how to program in this language, but it was very satisfying to figure it out.

Prolog
This language is probably the weirdest one in the set. Prolog is a pattern-matching (a.k.a. logic programming) language that excels at certain types of problems like scheduling and natural-language processing. Instead of a program being made up of expressions and executing statements in a sequential order, Prolog programs are made up of facts and rules, and the runtime environment solves for the rules given the facts and a question posed to it by trying different combinations of values for the free variables. It's a fascinating language. Mind-bending, but fascinating.

Scala
Scala is a hybrid language that is equal parts object-oriented and functional. It's the modern day equivalent of C++ for hybrid procedural and object-oriented programming, and it runs on the JVM so it has access to the entire Java edifice. Bridging these two programming paradigms makes it an important language to watch, but I could tell Tate thought it was rather boring. This chapter was the dullest of the bunch, and programming in Scala seemed fairly straightforward using either paradigm, compared to many of the other languages.

Erlang
Erlang is built on top of Prolog, so it retains much of the same weirdness of Prolog's pattern-matching logic programming paradigm, but softens it somewhat. What makes Erlang unique is its incredible robustness for highly-concurrent programs. Instead of threads, Erlang spawns lightweight processes for each task that needs to run in parallel, and those processes can be monitored and quickly restarted if they fail. It's a compelling concurrency model. You just have to get over the Prolog roots.

Clojure
Here it is—the one Lisp language of the set. Clojure runs on top of the JVM, like Scala, but it takes the path of a functional language. Personally, I love programming in Lisp. It has a certain elegance and expressiveness that other languages can't duplicate, and it's great to see a version of it have a chance at wider adoption in Clojure. It even eases the code syntax a bit by removing some of the parentheses. This chapter was especially enjoyable to work through.

Haskell
Tate saved the most challenging language for last. Haskell builds on many of the features of the other languages with pattern-matching, lazy evaluation, and list comprehensions. It is strongly-typed like Scala and uses type inference to take much of the burden of specifying types off of the programmer. Haskell's type system is truly legendary, and this chapter only scratches the surface of it. Haskell's also a purely functional language, so monads are needed to handle I/O and mutable state. I feel like I barely caught a glimpse of this language, but this chapter has motivated me to learn more.

I had such a blast going through this book and learning all of these languages, many of which I've been meaning to take a look at for some time. This book allowed me to do that efficiently, and now I know what I want to explore in more depth. While I wouldn't say I learned any of these languages in any detail, I was able to see the strengths and big ideas surrounding each of them, and I have a better sense of which languages are well suited for different kinds of problems. Sometimes that's half the battle of solving a problem. This book is a phenomenal resource for quick tours of different languages and programming paradigms. I can't recommend it highly enough.

Seven More Languages in Seven Weeks


Whereas in the first book I had at least known of all of the languages and was already fluent in one of them, nearly all of the languages in this book I had never heard of before, save one: Elixir. That ended up not mattering much, since almost every language was related to one that I already knew in some way. That meant I could slot the various programming models into my brain based on how they compared and contrasted with other languages. Not knowing of them before hand didn't make any difference in being able to learn about them during the course of the book.

I certainly learned plenty of new things as I went through the book, but by now you may be wondering, why am I subjecting myself to this onslaught of languages between these two books? As Bruce Tate explained in the introduction:
Each new language exposes you to a vocabulary, but not one of words. This new vocabulary is composed of the ideas that you use to shape your world. Though the precise syntax will almost certainly not commute from your sandbox into your production solutions, you'll see that many of the idioms do.
Different languages excel at different things. They have different programming models, and different things that they make easy or hard to do. They have different ways of solving problems. Learning about those different ways of doing things makes every program you write better because you can bring more resources to bear on the problem, even if you don't get to use the language that would be best suited to it. With that perspective in mind, let's see which languages this cadre of authors chose to explore.

Lua
Lua is a scripting language in the truest sense of the word. It's commonly used as the scripting language for video games and big scriptable applications. It runs almost anywhere, and is commonly used in embedded systems as a higher level language than the old stalwart embedded workhorse, C. It also integrates easily with C, and they showed how to do exactly that on day 3 of this chapter. The overarching abstraction in Lua is the table. Everything in the language is a table, and data and functions are added into an object's table to enable state and behavior. Tables even have metatables that allow the programmer to write their own programming models and override basic language behavior. It's an amazingly flexible paradigm for a language.

Factor
This language was the weird one of the bunch for this book. Factor is a stack based language as well as a functional language. While most functional languages use prefix notation (+ 1 1), and most other languages use infix notatation (1 + 1), because of the stack, Factor uses post-fix notation (1 1 +). Prefix notation is hard enough to switch to, but post-fix notation will melt your brain. It took awhile to get the hang of mentally parsing the code, and I don't feel like I truly grasped the advantages of this stack language. It was a fascinating exercise trying to learn it, though, and I'm glad it was included.

Elm
Elm was created specifically to bring some sanity to client-side JavaScript programming. It's a strongly-typed functional language that compiles to JavaScript, and is intended to be used for user interface development. The killer feature that makes Elm so interesting in this regard is signals. Instead of using callbacks to write asynchronous UI code in the browser, Elm programmers can configure signals that are generated by various interface elements and can be received by other code in the program to initiation relevant processing. It's a welcome escape from callback hell, and a really clean programming model for the browser. If only the language would hold still for a little while. It had changed significantly between the writing of the book and now, so it took some time to get certain parts of the code examples working.

Elixir
What I knew of Elixir already was that, like Ruby, it has a ton of syntax sugar to make code compact and beautiful. That's true, but it's not all. Elixir is built on the Erlang VM, so it comes with the same robustness and safety for concurrent programming that Erlang has refined for decades, as well as access to the Erlang libraries. Elixir is also a functional language, and adds other fresh programming features like the pipe |> operator for chaining functions together and for comprehensions, which are kind of like list comprehensions on steroids. To top it all off, Elixir has a powerful Lisp-like macro system to enable metaprogramming.

Julia
Julia is meant to be a scientific programming language in the same vein as MATLAB, R, and Python (well, Python is not specifically for scientific programming, but it's heavily utilized for that purpose). Julia is a dynamic language, but it's compiled so it doesn't suffer from the same performance slowdowns as the other interpreted languages. The goal is to get scientific computing performance from an easy to use language, and Julia makes some interesting trade-offs there. It also has plenty of syntax sugar for doing linear algebra and DSP calculations. I'll be curious to see if it makes any inroads into the machine learning space.

miniKanren
This language is the logic programming language of the group, but it doesn't have the weird syntax of Prolog. It's built on top of Clojure, so it has the weird syntax of Lisp instead. The neat idea with miniKanren is that because it's layered on top of Clojure, it's a logic-and-functional programming language, and that combination greatly increases the problem space for which it's well suited. Clojure can be used for program I/O and pre- and post-processing, and miniKanren can be used precisely where it shines with solving logical problems cleanly and efficiently. Another fun fact is that miniKanren is an implementation of the logic programming language developed in The Reasoned Schemer, which is another book I've been meaning to read.

Idris
The final language is another pure functional language with a strong type system, like Haskell in the previous book. They always save the most complicated language for last, don't they? Idris is written in Haskell, and it takes Haskell's type system to the next level with dependent types. This type system enables new kinds of type-checking sorcery by specifying that a vector type must be a certain length, for example, or that the output matrix must have the same dimensions as the input matrix. Types can even be dependent on operations of other types, so we're really programming in types here. I'm not sure, but Idris' type system might be Turing complete in and of itself.

The format of these seven chapters was fairly similar to the last book, but with four different authors, the tone was a bit different. The analogies with movies were still there, although I would say they weren't quite as entertaining. Instead, on each third day the authors showed the reader how to implement something relatively significant in the chosen language, and that exercise was quite satisfying. From a mini-game with bouncing heads in Elm to a rudimentary JPEG compression algorithm in Julia, the programming tasks they came up with were good and showed off the strengths of each language. It's another highly recommended book on multiple languages that was extremely well done.


So did I learn fourteen languages in four weeks? No, of course not, but that's not the point. All four authors from the second book said it best near the end of the book:
Some will try to tell you that this journey is worthless, that you can't truly learn a language in seven days any more than you can learn Italian by eating at the Olive Garden once a week. If you've worked through these exercises, you know different. Traveling for the sake of traveling is not worthless. True, on your brief trip you've not yet accumulated the fluency of a permanent resident, but you have been there.
I've learned a ton of new things from these two books and fourteen languages. They were all so different that the number of ideas covered was incredible. I had no idea that the world of programming languages was so rich and varied, and I've come away from this experience wanting to learn even more. I'm certainly going to explore Clojure, Prolog (or miniKanren), Elixir, and Elm more deeply, and I may even delve into Io and Haskell if I can find the time. These books have shown me much more of the map, and that it is filled with fascinating destinations. Now I know better where I want to go.

Monaco (Understanding Games #2)

This is the second article in a series documenting my "Game Camp for Grownups" at Williams College introducing humanities faculty to the medium of video games. [Previous article in the series: #1 PAC-MAN DX]


Monaco: What's Yours Is Mine (2013)
Designed by A. Schatz and A. Nguyen
Developed by Pocketwatch Games
Published by Majesco Entertainment for Windows, OS X, Xbox 360, and Linux

Monaco is an indie video game that combines the elegance of the "PAC-MAN" game with the theme of the Ocean's Eleven movie. It is best experienced with four players on a couch cooperating to execute heists...which invariably go wrong.

An early version of Monaco won the 2010 GDC Independent Games Festival  Excellence in Design and Seumas McNally Grand Prize awards. The McNally award for independent games is comparable to the Sundance Grand Jury Prize for independent film.


Advice for Playing

Monaco doesn't have a great tutorial on the controls and strategy...it is an indie game that expects more literacy and perseverance than we might have for our second game ever. The actual gameplay is accessible, you just need some advice:

Controls


  • Use the left stick to move
  • Hold the left trigger to sneak, so that you don't alert the guards. (Other noises such as healing and the Mole digging will also alert guards!)
  • Use the right stick to aim when you have a gun
  • Use the right trigger to use your current item: shoot a gun, launch a smoke bomb, plant explosives, etc.
  • The A button selects on menus. The B button cancels or returns to the previous menu. This is most important on the character selection screen.
  • The A button brings up the HUD for a short period of time. It displays your character's inventory and health around the character and the current objective on the lower-right of the screen.
  • The start button swaps between online and local play on the main menu
  • Pressing continuously against a door brings up a timer. When the timer completes, the door is unlocked and you can walk through it. Some doors lock behind you.
  • You can also "open" bushes and hide in them, unscrew light bulbs, activate computer terminals, and take other actions to affect the map.
  • The Mole's digging mechanic is the same as opening a door, but he can use it on most (but not all) walls.
  • The Cleaner just runs over an unalarmed guard from behind to use his ability

Strategy


  • This is a game about map traversal, not primarily about twitch. Remember what you learned in PAC-MAN.
  • Monaco is primarily a stealth & strategy game. Move slowly, keep the team together, and plan your movements from safe zone to safe zone.
  • You will very rarely use guns. They are distributed sparsely and have little ammo. Save them for a desperate moment, or a carefully planned attack.
  • This is a role playing job...everyone has to pick a good combination of roles for the map, and then actually play them. Let the Locksmith open doors, wait while the Cleaner runs out and neutralizes the guards, have the Mole strategically create new passages for you, etc. Do not "Rambo" and run off on your own.
  • When one player is in a bush or the exit, it is held open and others can run in without a timer.
  • When one player has unlocked a door and is standing in its doorway, the other players can run through it. Have the locksmith open doors and then hold them open so that others can go through.
  • You can hide in the exit, a bush, or a catwalk until things calm down, and then leave it again.
  • You can't hide in a bush while a guard is watching you...break line of sight first
  • Guards display their state with icons, which slowly fill up as they change state:
    • ZZZ (Sleeping): you can sneak in front
    • No icon: you can sneak past behind
    • ?: the guard is looking for you, but not yet alarmed
    • !: the guard is alarmed and actively seeking you to attack
  • When you're going to "die", run to some place that will be easy for the team to revive you. Avoid dying right in a patrolled hallway or in a bank vault covered with laser trip wires because it will be hard for someone to stay there long enough to heal you.
  • You should be able to complete most levels in 5-10 minutes one you have a good plan. Assume that your first play through on each level is just to explore the map and make a plan, and that you'll have to play each one twice.

Concepts

Some high-level ideas to consider as you play Monaco are:

  • Implicit design
    • Player communication + cooperation as a mechanic
    • Time as a resource
    • Fiction explains the rules
    • Fiction in place of (vs. requiring) assets; the game in the mind
  • Emergence
    • Complex scenarios from simple rules
    • The players' experiential stories vs. the games' explicit narrative
  • Minimalism
    • Complex interactions from simple controls
    • Less-is-more graphic design
    • Dynamic and tiny user interface for significant state


Cooperative Multiplayer

Each player in Monaco controls a character on the (cooperative) heist team. As in cooperative games such as Left 4 Dead, Team Fortress, and Overwatch, each character has a specific role created by their unique abilities. This increases cooperation through interdependence.

Aside: this style of game is sometimes called an "action role-playing game" (ARPG) to distinguish it from theatre-exercise style "role playing" of inhabiting a character; "pen-and-paper role-playing games" such as Dungeons & Dragon use "role" in both senses.

For example, the Redhead charm enemies and the Mole can break through walls. All characters can perform the basic functions of manipulating weapons (which are sparsely distributed), picking up loot, and opening doors.

As with the Left 4 Dead series, the mechanics of Monaco particularly reward teamwork and make players feel dependent on one another. Many levels are best accomplished with a plan and each player filling a specific role. Player characters can't be killed...but they can be knocked unconscious and must be revived by each other. Player communication is one essential mechanic for the game, and it interestingly is a mechanic that is implicit instead of coded in the game's rules and software.

Monaco's style of multiplayer fits the game's theme and has a specific socially valuable effect. It was also chosen intentionally. There are many different kinds of multiplayer game. Some elements that affect the style of play are:

  • Are the players physically in the same space, as I recommend for Monaco, or in different locations connected by the internet?
  • Cooperative vs. teams vs. everyone-for-themselves competitive
  • Are players sharing a screen? Some mobile and "LAN party" games are intended for players on different computers who are still in the same physical location. This allows private information for each player.
  • If the players share a screen, do they also share a view, or are there multiple small viewports on the screen (e.g., as in Halo)?
  • Do the players have distinctive roles?
  • Are the abilities of opposing players/teams symmetric or asymmetric?
  • How many players are in a game? Halo co-op supports two, Monaco supports four, Rocket League supports eight, Overwatch supports twelve, Battlefield 1 supports 64..., EVE Online supports tens of thousands.
  • Is play real-time or turn based? If turn based, is it synchronous or asynchronous?
  • Can artificial intelligence ("bot") players be substituted for humans?

Cooperative play in Monaco

Fiction

We know from "PAC-MAN DX" that the game medium relies primarily on mechanics to create the experience, with visuals, audio, story, and characters in supporting roles. These supporting elements are broadly called "content" or "assets" by game developers during production.

For analysis purposes, the content is often referred to as the "fiction," "frame tale," or "theme" (in the sense of "theme park", not literary theme) of the game.

Monaco has an overarching narrative motivating each game level, which is primarily explained by loading screen text. The writing and music are superb. This fiction serves its traditional game roles:

  • Make game mechanics concrete and intuitive (we pick up "gold," use "weapons" to attack, are slowed in traversal by "doors," etc. which need no explicit explanation compared to abstract "points," "powerups," and "zones")
  • Provide a MacGuffin (artificial and irrelevant motivation) for in-game goals
  • Draw together
  • Enhance engagement by stimulating more senses and modes of thinking

This is our first game with human characters. Each has a distinctive personality appropriate for their ability that is brought out on the loading screens. The storyline and characters are banal. That is intentional, and not a flaw.

For a game with complex mechanics and emergent gameplay like Monaco, the players' attention needs to be on the mechanics and strategy. (This will be taken to an extreme by XCOM later in our series.)

Ocean's Eleven (1960)
The cliched story and characters allow players to instantly understand the motivation, key game elements, and setting so that the game can get underway. If the game instead dropped players into a complex and novel narrative, they would not have enough information to make choices without significant exploration of the game world...it would become a game about discovery, and not a game about strategy and rapid tactical maneuvers.

Even ensemble movies, TV episodes, and plays have a protagonist whose storyline and viewpoint frame the experience. One interesting aspect of Monaco's couch-multiplayer, coop, shared-view approach is that there really is no protagonist. The viewpoint and story are shared. The story elements introduce the Locksmith as the protagonist, but this isn't mirrored in the mechanics and gameplay.

Portrayal

The characters are all white Europeans, and only two of eight are female. One of the female characters has a sexual theme and the other a passive, "den mother" role (the Lookout is the most useful character for the team and the least fun to play). There appears to be some age range, from teenage hacker to the late 50's Gentleman.

Penny Arcade's interpretation of the Monaco
characters. The actual in-game silhouettes from the
storyline are at the bottom with their colors.
Monaco clearly inherited these sterotypes from classic heist films such as Ocean's ElevenItalian Job, The Great Train Robbery, and Heat, with a dash of James Bond thrown in. The game isn't about the characters and they are represented as a handful of colored rectangles in actual gameplay. So in this case, I think this lack of diversity is a disappointing statistic and missed opportunity more than something worth analyzing further.
The playable characters in Left 4 Dead 2

For reference, the Left 4 Dead series that I mentioned earlier provided a more ethnically diverse cast of playable characters that might be easier for more players to identify with. Although there are still only 2/8 female characters, they are not restricted by their gender.

After Game Exercises

You may want to look at the PAC-MAN DX responses below before moving on to this week's exercises.

  1. As with any game, analyze the objective state and rules of the game. List these explicitly. Focus on the state of the player characters: health, inventory, position (in 3D, due to catwalks!), and then move on to the map.
  2. Draw the mechanical connections between "PAC-MAN" and Monaco. Can you think of other rich modern games that draw heavily on more abstract 1980's games?
  3. An elegant mechanic in both board and video games is to use time as a resource. Monaco does this in several ways. Name and discuss them. Why is this "elegant" compared to an explicit resource such as ammunition?
  4. Explore the mechanics of a single character. Speculate on why the design has the abilities and restrictions that are present for that character to balance its utility (there is no "best" character) and enjoyment. For example, for example, some walls are unbreakable by the Mole.
  5. Consider the medium-specificity of works. I contend that Monaco is the loose equivalent of The Usual Suspects or Ocean's Eleven as a game. If the designers had pressed a script directly into the gameplay, how would a literal transcription of a heist film into a game succeed or fail in a the new medium?
  6. Stories are essential for human communication, including entertainment. The key for emergent games is to note that the real stories are emergent, regardless of the framing narrative. For example, players don't talk about "the twist right after the Hacker was revealed" in Monaco. They talk about "when I was knocked out right under the laser trap and you walked unnoticed right behind the guard to rescue me, timing it with the trap's phases..." How do the mechanics of Monaco create unique and powerful emergent stories?
  7. Review the different ways that multiple players can engage the same game from the multiplayer style list above. Discuss how Monaco would be affected by changing the style of multiplayer. For example, it could have been asymmetric multiplayer with one team controlling the guards. Why is this mode not offered? (N.B. The game can be played single player and multiplayer using separate computers across the internet. I find these vastly inferior.)

Recommended Reading

Monaco does a nice job of minimizing the controls and user interface required for a relatively large number of actions and per-character state. Swink, Game Feel: A Game Designer's Guide to Virtual Sensations, Morgan Kaufman, 2008 is the canonical text on control design and how it affects the player experience. The introduction alone is worth the read, even if you don't get much farther.

A core idea that most game designers (and probably many theorists) ascribe to is that the actual game exists in the player's mind, not on the screen. The abstract art style of Monaco combined with the evocative fiction allow players to imagine the world of the game more vividly than could be depicted with current graphics. Shell, The Art of Game Design: A Book of Lenses, CRC Press, 2008 explains this concept in the early chapters (see chapter 2 specifically) and then moves on to analyze game mechanics.

Monaco contains graphic elements and sounds that are clearly "in the world" and observed by the characters (e.g., gold, walls), others which are clearly not visible to characters (e.g., health bars, timers), and some which denote the characters' knowledge but are represented differently to the players (e.g., the map blueprint). This happens in film as well, but less frequently. For example, characters are clearly not aware of voice over, on-screen location titles, and theme music. Juul, Half-Real: Video Games between Real Rules and Fictional Worlds, MIT Press, 2011 presents tools for analyzing these different levels of representation and reality in games.

PAC-MAN DX Responses

Sample responses to the PAC-MAN DX discussion questions from last week are below.


1. The state of PAC-MAN DX, organized hierarchically, is:


  • pacman
    • x, y position in pixels [not grid squares...pacman can appear at any pixel on the screen and isn't snapped to the power-pellet grid]
    • moving direction: up/down/left/right/still
    • speed in pixels/second (more likely, pixels/frame)
    • direction to turn at next intersection: up/down/left/right
    • list of previous positions, used for ghosts that are trailing
    • animation frame index
  • maze is a grid, storing at each square:
    • obstructed by a wall: true or false [this is tricky. As in the original PAC-man, walls appear to be two "squares" thick, counting pellets. But the walls actually are drawn pushed forward and back slightly from the real grid]
    • contents: empty/pellet/power pellet/fruit
  • ghosts:
    • x, y position in pixels
    • moving direction: up/down/left/right/still
    • eatable? [you can tell that this is per-ghost state instead of global because new ghosts that spawn after you eat a power pellet are not themselves eatable]
    • awake?
    • animating being sent to the center via bomb?
    • how far behind pacman on trail (0 = not trailing)
    • holding: nothing/power pellet/bomb
    • color
    • ...and some animation and artificial intelligence information
  • game
    • number of bombs left
    • number of lives left
    • index of the current dot pattern on the left
    • index of the current dot pattern on the right
    • speed
    • time left
    • score
    • last ghost score (used for chaining bonuses for eating lines of ghosts)
    • ...plus some animation and collision slow-down information


2. The choices are interesting. The only literal choices proscribed by the rules for inputs that the player can provide (ignoring pausing and such) are when to push the four direction buttons and the bomb button during the game. If we step back, we see some higher-level choices that are more useful for analysis.

First, the player can choose the graphics. These add some variety and some help a little with reading the map, but there's not a significant strategic value there.

Second, the player can choose the starting speed. This is very significant. Because the game runs on a fixed timer (in the starting modes), a higher speed allows the player to earn more points in fixed time. It also reduces the time to plan and think.

A player with sufficient knowledge of the map and reasonable experience with the controls should always choose the highest speed if their goal is to maximize points (it is reasonable to have a different goal--playing as a less-stressful pastime--and choose a different speed to better satisfy that.)

Once inside the game, the player has a strategic choice in the map traversal. I suspect that there is an optimal path to collect all pellets and eat the most ghosts in the least time, and the patterns are predetermined so it is possible to learn this path. Falling short of optimality, there are broader strategic choices such as whether to trail a large number of ghosts or avoid them outright, whether to turn and eat those ghosts at the first opportunity or leave them there to build a larger bonus, etc. There are small tactical choices (which mostly arise when the player fails to execute the intended strategy perfectly) of how to respond to ghosts: bombs, allowing PAC MAN to lose a life, or attempting to dodge.

Let's not forget the ultimate choice: whether to play at all. For many media, the only choices are whether to watch/read/play the work (possibly: again), the ambient conditions for experiencing it, and whether to finish. Many of the tools of analyzing games can be applied to these choices.


3. The rules are something like:

   If the player presses a direction button:
       if the direction button is opposite the current moving direction or the current moving direction is still:
             Immediately set pac-man's moving direction and next turn direction to match the button
       otherwise:
             Set pacman's next turn direction to match the button

   If pacman is at the center of an intersection:
      change the moving direction to the next turn direction

   If the distance between pacman and a ghost is less than 1/2 the sum of their widths:
      if the ghost is eatable:
            destroy the ghost and increase pacman's score
      otherwise, if pacman has more than one life left:
            destroy all awake ghosts
            reset pacman
            decrement the number of lives
      otherwise:
            game over
    ...

I'll omit responses to the more subjective critique questions.


Next in this series: Understanding Games #3: Inside


Morgan McGuire (@morgan3d) is a professor at Williams College, a researcher at NVIDIA, and a professional game developer. His most recent games are Project Rocket Golfing for iOS and Skylanders: Superchargers for consoles. He is the author of the Graphics Codex, an essential reference for computer graphics now available in iOS and Web Editions.

Download (77.1 MB) Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

Candy Crush Saga APK

The description of Candy Crush Saga

Candy Crush Saga, from the makers of Candy Crush Soda Saga & Farm Heroes Saga!

Join Tiffi and Mr. Toffee on their sweet adventure through the Candy Kingdom. Travel through magical lands, visiting wondrous places and meeting deliciously kookie characters! Switch and match your way through hundreds of levels in this delicious puzzle adventure. The sweetest game just keeps getting sweeter!

-------------------------------

Take on this deliciously sweet Saga alone or play with friends to see who can get the highest score! 
-------------------------------

Candy Crush Saga is completely free to play but some in-game items such as extra moves or lives will require payment.

-------------------------------

Candy Crush Saga features:

● Collect sugar drops to advance along the sugar track for special suprises!

● Tasty candy graphics that will leave you hungry for more

● Unwrap delicious environments and meet the sweetest characters

● Helpful magical boosters to help with challenging levels 

● Complete adventurous levels and unlock treats

● Easy and fun to play, challenging to master 

● Hundreds of sweet levels in the Candy Kingdom - more added every 2 weeks!

● Leaderboards to watch your friends and competitors!

● Easily sync the game between devices and unlock full game features when connected to the Internet

-------------------------------

How to Win Candy Crush Saga?

1.       Create Power Candies

Striped candy by adding four candy horizontally or vertically.

Wrapped candy by creating two three-match combination in a single move. Like letter 'T' or 'L'

Color bomb by aligning four candies of the same color.

2.       Save up Power Candies to Get Super Combos

Don't use power candies as soon as you get them. Combine power-up candies and get more powerful.

Use rainbow sprinkles, pink crusted doughnuts, jelly fishes, striped candies, wrapped candies and color bombs etc.

Swap two striped candies to clear candies horizontally and vertically.

Swap two wrapped candies to clear a five by five explosion of candies surrounding it.

Swap two color bombs to clear all the visible candies in the play area. This is the most powerful.

Swap a striped candy with a wrapped candy to clear three rows/columns of candies horizontally and vertically.

Swap a striped candy with a color bomb and it can upgrade all the candies on the same color as striped candy.

Swap a wrapped candy with a color bomb and it can upgrade all the candies on the same color as wrapped candy.

3.       Remember your Mission

Do remember your mission and don't be busy creating super combos.

Missions are:

Moves levels. Jelly levels. Timed levels. Ingredient Drop levels. Candy Order levels etc.

4.       Pay Attention to Those Jellies on the Edge.

These jellies are more difficult to clear because of their position so always remember to clear them first and you will have more chances to win. 


Already a fan of Candy Crush Saga? Like us on Facebook and share us with your opinions about the game.


Rating : 4.4 of 5.0
Developer : King
Versi : v1.89.0.10
Update : 2016-11-30
Ukuran : 77.1 MB
OS : v1.89.0.10 (1089010) for Android 2.3.2+ (Gingerbread, API 9)
Download 77.1 MB

Wednesday, March 27, 2019

How To Download Real Ps3 Emulator On Android


Hello Friends I Am Showing How To Download Real PS3 Emulator For Android Device And I Am Proof That Emulator Is Work Or Not And That Emulator How To Work And How To Play Ps3 GAme On It.

                      Screenshot 






🔲How To Install

⚪️First Download Ps3 Emulator.
⚪️After Download Ps3 Emulator Install It.
⚪️Open PS3 Emulator And aslo On Your Internet.
⚪️Then Open PS3 Emulator And Download Game And Enjoy.

🔲How To Download

The Download Link are given and Download link is Google Drive link Click Download Here Button And Download It.

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Download Link 

     Click Here




▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Tuesday, March 26, 2019

Eminent Domain Is Online At Board Game Arena!

I'm happy to announce that as of yesterday, my card game, Eminent Domain, is available for online play at BoardGameArena.com! Check it out, it's free to play, and they did a great job with the implementation.

I've been playing a lot of games at BGA over the last couple of months, including:

Eminent Domain
I got early access and did some testing for bugs. The implementation is gorgeous, and the game holds up! They've included the 5 scenarios that came with Eminent Domain: Microcosm, and very soon they might add the 6 from Escalation that only require base game cards to use.

Tzolkin: the Mayan Calendar
An old favorite that I hadn't played in a while. The timing aspect of the placing/retrieving of workers is ingenious. After playing a lot (and watching the top players' games), I'm actually a little disappointed in the game balance, but it's still a very fun game.

Stone Age
A classic worker placement game that I haven't played in a long time.

Russian Railroads Another good worker placement game that I haven't played in a while. It's neat how you score point income rather than just points, so rushing to scoring conditions can really add up! You can also pull of some fun combos with the reward tiles.

Dice Forge
This "dice building" game is a new one for me. I find it well balanced and fun. I like it best head-to-head, and I wish there were more cards to choose from each game (and more variety in what they do), but I hear that might be coming in an expansion.

Sobek
I own this, but haven't played it in years. Another good one for head-to-head play. I didn't even realize it's by Bruno Cathala!

A Donut In My Hair?

Hey everyone!

I'm back, just as I said I would be, to talk to you about my new favorite hairstyle. Now, I had been dying to try out this hair since I saw a video by Venus Angelic entitled: How to do the Perfect Bun. She used a knee high sock that she cut and rolled up to achieve the look, but I didn't have any knee-length socks to do that on.

So, I went to Claire's. I knew Claire's had a pretty wide assortment of hair accessories, so I was hoping they would have something that is apparently referred to as a hair donut. So I walked into Claire's, with my mother since we had just finished enjoying a really wonderful meal at the little Chinese restaurant in the food court, and headed over to their hair accessories.

And I have to say, when it comes to hair accessories, I am completely in love with Claire's. They have just about everything. And after taking entirely too long staring at the flower headbands, debating whether or not they were worth the $10, I finally decided on my two items and hurried home to try them out. And this is what I got:


I am completely in love with this hairstyle now. It's so easy! I literally only have to spend about 5 minutes on my hair. A minute to brush it out, a couple to get my hair up into a ponytail (since I'm really bad at putting my hair into ponytails for some reason), a minute to put on the bun and second elastic, and another minute to pin my hair in place and add the bow. It's the easiest bun I've ever done. And I love how it looks!

I'm really happy with my bow I picked out too. It was much cheaper than the flower headbands/crowns and really cute. Plus, I've been needing a new bow. There were so many pretty colors, I had the hardest time choosing which one to get. But I decided white would go with most of my clothes, so that's the one I ended up with.


That's what the hair donut looks like for those of you that don't know. You just put your ponytail through the middle, and the rest is quite easy. You end up with very nice, neat hair, like this:


The bun is a little large (you can get smaller), but for my hair, a bun that large was basically required to be able to hold such long hair. And I love it anyway.

And that day I was in quite a hair styling mood, so I asked my mom (well, more like pleaded with her) to do her hair in a new way too. She was nice and agreed, and so she would up with hair like this:


I really love ribbon buns. This was my second attempt. The first... well, we just won't go into that, alright? But I was quite proud of my second attempt. From the front, at least. It looks a bit horrible from the back, but nothing that a bit of practice won't fix up. (Hopefully.)

Eventually I'll learn how to do it with my own hair too. Then I'll be really happy.

But there you have it, the donut bun and the hair bow bun. Two of my new favorite hairstyles.

What are your favorite hairstyles? 

Android Studio 3.3

Posted by Jamal Eason, Product Manager

We are excited to kick off the new year with a stable release of Android Studio 3.3 focused on refinement and quality. You can download it today from developer.android.com/studio. Based on the feedback from many of you, we have taken a step back from large features to focus on our quality fundamentals. The goal is to ensure Android Studio continues to help you stay productive in making great apps for Android. Since the last stable release, Android Studio 3.3 addresses over 200 user- reported bugs. This release also includes official support for Navigation Editor, improved incremental Java compilation when using annotation processors, C++ code lint inspections, an updated new project wizard, and usability fixes for each of the performance profilers. In addition, saving snapshots on exit for the Android emulator is 8x faster.

Android Studio 3.3 kicks off the broader quality focus area for the year, which we call Project Marble. Announced at the Android Developer Summit in November 2018, Project Marble is the Android Studio team's focus on making the fundamental features and flows of the Integrated Development Environment (IDE) rock-solid, along with refining and polishing the user-facing features that matter to you in your day-to-day app development workflows. In Project Marble, we are specifically looking at reducing the number of crashes, hangs, memory leaks, and user-impacting bugs. We are also investing in our measurement infrastructure to prevent these issues from occurring. Stay tuned for more updates and details as we progress on this initiative.

This release of Android Studio is a solid milestone for the product. If you want the latest in feature refinement and quality, then download Android Studio 3.3 today on the stable release channel. Watch and read below for some of the notable changes and enhancements that you will find in Android Studio 3.3.

Develop

  • Navigation Editor - The navigation editor is a visual editor which allows you to construct XML resources that support using the new Jetpack Navigation Component. With the Navigation Editor and the Navigation Component, you can build predictable interactions between the screens and content areas of your app. This editor was previewed in an earlier Android Studio release, but based on your feedback we held this feature to improve the quality of the feature. Thank you to the developers who gave us feedback. Learn more.

Navigation Editor

  • IntelliJ Platform Update - Android Studio 3.3 includes Intellij 2018.2.2. This is a significant platform release from Jetbrains, with new previews for the code editor, updated icons, MacBook Touch Bar support, plus enhanced version control integrations. Learn more.
  • Kotlin Update - This release of Android Studio bundles Kotlin 1.3.11, with support for Kotlin coroutines and contracts plus IDE support for the recommend Kotlin coding style. Learn more.
  • Clang-Tidy Support for C++ - Android Studio now has support for Clang-Tidy for C++ static code analysis. Similar to the current lint support for Java and Kotlin in Android Studio, Clang-Tidy helps those who have C++ in their Android app identify common coding errors and bugs. Enable the inspection by going to SettingsEditorInspections (Preference → EditorInspections for MacOS) . Learn more.

Clang-Tidy Code Inspection Settings

  • New Project Wizard update - To support the range of device types, programming languages, and new frameworks, we have updated the New Project Wizard for Android Studio. You can access the same project templates in a more streamlined user experience.

New Project Wizard

  • Delete Unused IDE Directories - To help you upgrade to the newest version of Android Studio, we have added a new feature to help clean up unused settings & cache directories. Past versions of Android Studio left these old directories that were hard to find and remove on your hard drive. When you first run Android Studio 3.3 and higher, the new dialog suggests directories that you can safely remove from past installations of Android Studio.

Delete Unused Directories Dialogue

  • IDE User Feedback - To help us to create a better product, we have started to include in-product sentiment buttons for quick feedback. For those who opt-in to sharing usage data, feel free to click on the icon that suits your sentiment while using Android Studio. To opt-in to give in-product feedback go to SettingsAppearance & BehaviorSystem SettingsData Sharing ( PreferencesAppearance & BehaviorSystem SettingsData Sharing for MacOS).

IDE User Feedback

Build

  • Improved incremental Java compilation when using annotation processor - This update decreases build time by improving support for incremental Java compilation when using annotation processors. The optimization requires Android Gradle plugin 3.3.0 or higher. Learn more.
  • Lazy task configuration - The plugin uses Gradle's new task creation API to avoid initializing and configuring tasks that are not required to complete the current build (or tasks not on the execution task graph). For example, if you have multiple build variants, such as "release" and "debug" build variants, and you're building the "debug" version of your app, the plugin avoids initializing and configuring tasks for the "release" version of your app. Learn more.
  • Single-variant project sync - Along with build speed, project sync speed can be a development bottleneck to for those who have large app projects with multiple build variants. In this version of the IDE, you can you can limit syncing to only the active build variant. In order for this optimization to work, your project needs to use Android Gradle plugin 3.3.0 or higher. You can enable this option under the Experimental preferences in Android Studio 3.3.

Single-Variant Project Sync

  • Android App Bundles now support Instant Apps - You can now build and deploy Google Play Instant experiences from a single Android Studio project, and include them in a single Android App Bundle. Launched last year, the Android App Bundle is the new standard Android app publishing format that you can build with Android Studio. This update streamlines and unifies the build artifacts that you upload to Google Play. Learn more.

Test

  • Multiple Emulator AVD instances - Android Emulator 28.0 now supports the ability to launch multiple instances of the same Android Virtual Device (AVD). Each instance of the AVD uses a minimal set of system resources. For those developers with continuous integration (CI) testing environments, this can be a convenient way to run tests in parallel off one AVD configuration. On the command line run the following commands:
    $./emulator -avd <avdname> -read-only & $./emulator -avd <avdname> -read-only & 

    Android Emulator: Multiple AVD Launch

  • Android 9 Pie Emulator System Images & Wi-Fi P2P - Alongside Android Studio 3.3, you can also download Android 9 system images for your emulator for your app testing. The Google Play emulator system images not only passe the official Android Compatibility Test Suite (CTS), they also include support for Peer-to-Peer Wi-Fi direct connections between two emulators. To start using this feature, launch the emulator (v28.0.22 or higher) via the command line and ensure the two emulators share the same Wi-Fi server and client port command line arguments.
    $./emulator @<server-avd-name> -wifi-server-port 9999 $./emulator @<client-avd-name> -wifi-client-port 9999 

    Android Emulator: Wi-Fi P2P Setup

  • Emulator Snapshot Save Speed - We have heard from you that you enjoy using snapshots and quickboot, but felt the time taken to close the emulator and Quickboot save a snapshot was slow. To solve this, we optimized the way snapshots are saved and managed, using a mapped file to save guest RAM. From aggregate metrics, we found that this optimization led to driving down the average quickboot save time from the last stable version to now from 27 seconds down to 3 seconds — a 8x improvement. Learn more about this enhancement and other recent improvements to the emulator here.

Optimize

  • Profiler performance improvements - Based on your feedback, we have dramatically improved Android Studio performance while using the profilers in this release. We've seen improvements on average of 2x in frame rates in our local tests. Please continue to provide feedback, especially if you continue to see performance issues.
  • Memory Profiler allocation tracking options - In previous releases, we have heard from you that, in some cases, your app performs significantly worse while profiling with the default settings. To address this, we have changed the default Memory Profiler capture mode on Android 8.0 Oreo (API level 26) and higher devices to sample for allocations periodically. You can adjust this setting in the Allocation Tracking dropdown menu. By default, we also now temporarily turn off allocation tracking during CPU recordings to minimize the impact on recording results. Learn more.

Memory Profiler: Allocation Tracking Options

  • Network Profiler formatted text - The Network profiler in Android Studio 3.3 now formats common text types found in network payloads by default, including HTML, XML and JSON. You can toggle between formatted and raw text by navigating to either the Response or Request tab, and click on the View Parsed / View Source link. Learn more.

Network Profiler: Formatted Text

  • CPU Profiler frame rendering data - The CPU Profiler now shows you the render time for each frame on the main UI thread and Render Thread when you record with Trace System Calls. If you are trying to investigate and understand the bottlenecks or the source of UI jank in your app, this data can come in handy to see where you can improve your app performance. Learn more.

CPU Profiler: Frame Rendering Data

To recap, Android Studio 3.3 includes these new enhancements & features:

Develop

  • Navigation Editor
  • IntelliJ 2018.2.2 Platform Update
  • Kotlin 1.3.11 Update
  • Clang-Tidy Support for C++
  • New Project Wizard update
  • Delete Unused IDE Directories
  • IDE User Feedback

Build

  • Improved incremental Java compilation when using annotation processors
  • Lazy task configuration:
  • Single-variant project sync
  • Android App Bundles now supports Instant Apps

Test

  • Multiple Emulator AVD instance Launch
  • Android 9 Pie - Emulator System Images
  • Emulator Snapshot Save Speed Improvement

Optimize

  • Profiler Performance Improvements
  • Memory Profiler: Allocation Tracking Options
  • Network Profiler: Formatted Text
  • CPU Profiler: Frame Rendering Data

Check out the Android Studio release notes, Android Gradle plugin release notes, and the Android Emulator release notes for more details.

Getting Started

Download

Download the latest version of Android Studio 3.3 from the download page. If you are using a previous release of Android Studio, you can simply update to the latest version of Android Studio as well. If you want to maintain a stable version of Android Studio, you can run the stable release version and canary release versions of Android Studio at the same time. Learn more.

To use the mentioned Android Emulator features make sure you are running at least Android Emulator v28.0.22 downloaded via the Android Studio SDK Manager.

We appreciate any feedback on things you like, and issues or features you would like to see. If you find a bug or issue, feel free to file an issue. Follow us -- the Android Studio development team ‐ on Twitter and on Medium.