Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

matrix in assembly 8086 mxn dimension

matrix assembly

  • Please log in to reply
15 replies to this topic

#13 zemzela


    CC Regular

  • Member
  • PipPipPip
  • 30 posts

Posted 06 January 2012 - 01:54 PM

I want to see the task in java script , could you give me the link where you write your task....
  • 0

#14 dargueta


    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 06 January 2012 - 02:42 PM

I'd say yes; instead give him/her pseudocode and some pointers to help get him/her going.
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'

#15 zemzela


    CC Regular

  • Member
  • PipPipPip
  • 30 posts

Posted 06 January 2012 - 02:47 PM

Do you know how to write code for my task which I show above? Do you understand the task?
  • 0

#16 RhetoricalRuvim


    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 06 January 2012 - 05:01 PM

Okay, the idea I used was keeping track of the current position of a "cursor" and also keeping track of "walls."

There is of course the top wall, the bottom wall, the left wall, and the right wall. You'll also have to keep track of the "cursor" (or your) position.

You can imagine that you start at the top-left corner, and you walk down, until you hit a wall. Then you turn, and walk, until you hit the next wall. You keep going like this. However, every time you hit a wall and start towards another direction, you have to pull the wall behind you in by 1, to make sure you don't ever walk through squares you already walked through. When you walk the m * n number of paces - with m and n being the width and height of the matrix - you're done spiraling in through the matrix.

Here's what I mean:
Posted Image

I hope this helps, and that you understood what I mean. So now you just have to write the formulas and algorithms and functions. Should you have any further questions, you can post them here (which I think you already know anyway :D, but this sounds more professional :cool:).
  • 0

Also tagged with one or more of these keywords: matrix, assembly

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download