Javascript

Javascript Mandelbrot Browser

I was inspired by my recent attempt at creating a parallel Mandelbrot generator for Minnow to learn some javascript and make a javascript version of it.

Here is an actual example of this code in use.

The javascript itself is pretty simple:

function point(t_x, t_y)
{
	this.x = t_x;
	this.y = t_y;
}
 
function color(t_r, t_g, t_b)
{
	this.r = t_r;
	this.g = t_g;
	this.b = t_b;	
}
 
function get_color(t_point, t_center, t_width, t_height, t_scale)
{

Do You Know What ++i And i++ Really Do?

An interviewer who thinks he is being clever might present you with a code sample like the following and ask you what the output would be:

//C
#include <stdio.h>
 
void dosomething(int i, int j, int k, int l)
{
  printf("%d, %d, %d, %d\n", i,j,k,l);
}
 
int main(int argc, char **argv)
{
  int i =1;
  dosomething(i++, ++i, i++, ++i);
 
  i = 1;
  printf("%d\n", i++ + ++i + i++ + ++i);
 
  i = 1;
  printf("%d\n", (i++) + (++i) + (i++) + (++i));
}

Syndicate content