Skip to main content

Loop for success


I was thinking about what it takes to follow through and achieve goals- I came to the conclusion that it's just all about writing good loops that keep you going- that keep you repeating the same behaviors/activities required to achieve your goal-

A simple C# "for" loop looks like this

for(int index = 0; index < listOfItems.Count; index++)
{
//do this
//then this
// then this etc
}

What this is doing is looking at your listOfItems and repeating the same thing over and over until it's gone through the whole list-

It will only STOP when the whole list is finished-

So let's say for example- this "list" is a shot list for an animation or film?

The loop will keep running until you have gone through the whole shot list- with this current code it won't stop for any other reason-

This part controls when it stops " index < listOfItems.Count "

index is being incremented each time with index++

So again, it will only stop when index is not less than the number of items-

Wouldn't it nice if you couldn't program yourself like this? So that you only stopped when all the work was done?

In reality if we were programmed these loops would have lots of "OR" operators which look like this ||

So if you write if( A == true || B == true) you're saying if A OR B is true- if we put this in our loop if would stop if A or B is true-

So this is how most people's loops would look like-

for(int index = 0; index < listOfItems.Count || decidesThisIsTooHard || fakeBookBeckonsTooMe || isReallyDrunk ; index++)
{
//do hard repetitive work
}

A more productive loop looks like this-

for(int index = 0; index < listOfItems.Count || iamPhysicallyDead ; index++)
{
// do hard repetitive work
}
So whatever it is you're trying to do-

Get it down to a repeating list of actions and loop through it with NO IF's - &&ND's - or ||OR's

I would say its ok to use XOR because sometimes you have to keep things secret-

Comments

Post a Comment

Popular posts from this blog

What format should I render out of Cinema 4d with?

UPDATED 2_27_13!  RENDER USING EXR Lossy Zip16! Since I'm working on a new feature film that will generate over 1500 shots made up of image sequences I need to make sure I choose the right file format to render to lest my hard drives explode. What I need from my format is  at least 16bit, an alpha included and preferably small size. I rendered out a frame from my film tallied up all the file sizes here- their all different types of codecs listed from smallest file size to largest. The render includes an RGBA pass, Depth pass, and Material Luminance pass because thats what I always render out. 1.00mb 8bit-Photo Jpeg %100 1.27mb 8bit-PNG 4.65mb 16bit- EXR lossy ZIP16 5.75mb 8bit-PSD 6.23mb 16bit-EXR lossy PLZ 6.44mb 16bit-PNG 7.94mb 8bit-TIFF 8.50mb 16bit-EXR Lossy 24 9.05mb 16bit-EXR Lossy Run Length 14.6mb 8bit-TARGA 22.4mb 32bit-EXR ZIP16 24.6mb 32bit-EXR Zip1 25.6mb 32bit-EXR PLZ 29.3mb 16bit-TIFF 29.3mb 16bit-PSD 40.0mb 32bit-EXR Run Length 58.7mb 16

Aggregated feedZ

So I totally aggregated all meh rss feedZ...So in this one handy like feed thing you can get... -Meh blog posts -Meh EXCITING Facebook status updates (ex. "I'm so FACE") -Meh youtube videos -Meh Vimeo videos -Meh Blogtalk radio episodes - and much more (actually just like some other xml code that i don't understand) Just subscribe via this link and you can get all that for a low low price of...oh wait it's totally FREE ^ ^

So a guy is trying to take credit for my film...

TLDR- Scroll down to THE THIEVERY My name is Mike- I make films under the name "M dot Strange" and I have done so for the past 10+ years- this is my story as a filmmaker culminating in a recent event wherein a "filmmaker" tried to take credit for my life's work Here's my imdb page with my film credits  My web site Here's a reel with stuff from my original films in which I wrote/created/designed/animated etc everything that you see- I can and have performed all aspects of animated film production on my films- thats sort of how I made a name for myself- by being a one man animated film studio Here's a presentation from 2014 with me discussing the production of my last film My first animated feature film "We Are The Strange" premiered at the Sundance Film Festival in 2007 Sundance archives link Article about the film Link to the film Film's site Because of the buzz that film generated I was given offers to sell the