QB64

Para los que les guste la programación de los años 80 como a mí, aquí les dejo el enlace de QB64, un IDE compatible con el BASIC de la época pero muy mejorado. A mi me ha permitido revivir los programas de aquellos años y darme cuenta de que no eran tan malos como muchos nos quieren hacer creer en base a los super modernos y en algunos casos estúpidos lenguajes actuales. Es compatible con Windows, Linux, Mac OSX, y Android.

Welcome to the QB64 Programming WIKI

QB64 is a modern version of the Basic programming language that allows programs created using Quick Basic 4.5 or Qbasic to run on Windows XP, Vista, 7, 8, 8.1 and 10, Linux and Mac OSX. It will work on 32 or 64 bit machines and has many new features such as stereo sound, improved graphics and TCP/IP internet capabilities. QB64 can make reliable programs or games for the entire family!QB64 does not install any files outside of the qb64 folder or use the Registry! May require Administrator permissions.

Programming in Basic is EASY! You don't need to learn much to get started as it uses many statements and function words that are familiar to you. You can learn to program in days instead of weeks! If you need help there is a forum to ask for help and this WIKI has many example programs that you can run to see how things work. Download QB64 and take a ride into the wonderful world of programming! We are sure that you will enjoy the experience! We have programmers from age 10 to over 60. Welcome aboard!






http://www.qb64.net/

http://www.qb64.net/wiki/index.php/Main_Page


Depths - Processing 3






//Depths
//Ale González, 2013
//A drawing generator created to show how to implement an efficient perlin noise vector field using lookup tables

final int
  WIDTH   = 800,
  HEIGHT  = 800,
  MAX_AGE = 100,
  STEPS = 900,
  FILL = #000000,
  STROKE = #FFFFFF,
  ALFA = 50,
  BACKGROUND = #EEEEEE;

final float
  SMOOTHNESS = .0005;

PVector[] DIRECTIONS;
int[][] INDICES;
ArrayList<Particle> particles;

PGraphics bg;

void setup()
{
    size(800, 800);
    fill(FILL, ALFA);
    stroke(STROKE, ALFA);
 
    //Create a fancy degraded background
    reset();
 
    //LUT to store the indices associated with the vector field
    INDICES = new int[WIDTH][HEIGHT];
    for (int y = 0; y < HEIGHT; y++) for (int x = 0; x < WIDTH; x++)
        INDICES[x][y] = int(noise(x*SMOOTHNESS, y*SMOOTHNESS)*STEPS);

    //LUT to store the directions associated with the vector field
    DIRECTIONS = new PVector[STEPS];
    for (int i = 0; i < STEPS; i++)
        DIRECTIONS[i] = new PVector(cos(i*.5)*.1, sin(i*.5)*.1);
 
    //Particles
    particles = new ArrayList<Particle>();
}

void reset(){
    loadPixels();
    for (int i=0; i<WIDTH*HEIGHT; i++)
        pixels[i] = (0xFF - floor(dist(i%WIDTH, i/HEIGHT, WIDTH/2, HEIGHT/2)*.25)) * 0x01010101;
    updatePixels();
}

Processing 3.2.3


Processing es un lenguaje de programación y entorno de desarrollo integrado de código abierto basado en Java, de fácil utilización, y que sirve como medio para la enseñanza y producción de proyectos multimedia e interactivos de diseño digital. Fue iniciado por Ben Fry y Casey Reas a partir de reflexiones en el Aesthetics and Computation Group del MIT Media Lab dirigido por John Maeda.

Se distribuye bajo la licencia GNU GPL.

Al estar basado en Java, puede heredar todas sus funcionalidades, convirtiéndose en una herramienta poderosa a la hora de encarar proyectos complejos.
Vale la pena echarle un vistazo a este lenguaje. Mis hijos los están utilizando ampliamente. No es difícil.










/**
 * Esfera
 * by David Pena.
 *
 * Distribución aleatoria uniforme sobre la superficie de una esfera.
 */

int cuantos = 16000;
Pelo[] lista ;
float radio = 200;
float rx = 0;
float ry =0;

void setup() {
  size(1024, 768, P3D);

  radio = height/3.5;

  lista = new Pelo[cuantos];
  for (int i = 0; i < lista.length; i++) {
    lista[i] = new Pelo();
  }
  noiseDetail(3);
}

void draw() {
  background(0);

  float rxp = (mouseX-(width/2)) * 0.005;
  float ryp = (mouseY-(height/2)) * 0.005;
  rx = rx*0.9 + rxp*0.1;
  ry = ry*0.9 + ryp*0.1;

  translate(width/2, height/2);
  rotateY(rx);
  rotateX(ry);
  fill(0);
  noStroke();
  sphere(radio);

  for (int i = 0; i < lista.length; i++) {
    lista[i].dibujar();
  }

}

Ordenar mayor a menor




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero20
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
//Variables
int numero1, numero2, numero3, mayor, intermedio, menor;

private void textBox1_TextChanged(object sender, EventArgs e)
{
numero1 = int.Parse(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
numero2 = int.Parse(textBox2.Text);
}

private void textBox3_TextChanged(object sender, EventArgs e)
{
numero3 = int.Parse(textBox3.Text);
}


Factorial mediante una Función




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero19
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
//Variables
int numero, f, i;

private void textBox1_TextChanged(object sender, EventArgs e)
{
numero = int.Parse(textBox1.Text);
}
//Proceso

private void button1_Click(object sender, EventArgs e)
{
f = Factorial(numero);
textBox2.Text = f.ToString();
}


Par o Impar mediante procedimiento




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero18
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Variables
int numero;
string resultado = "";

private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
//Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
numero = int.Parse(textBox1.Text);
}
//Proceso


Minúsculas a Mayusculas






using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero17
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Variables

string textoentrada, textosalida;

private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
//Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
textoentrada = textBox1.Text;
}


Potencia de un numero




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero16
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

//Variables
short entero, exponente;
int potencia;

//Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
entero = short.Parse(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
exponente = short.Parse(textBox2.Text);
}


Función para eliminar espacios en blanco




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero15
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

//Variables
string textoentrada, textosalida;

private void textBox1_TextChanged(object sender, EventArgs e)
{
textoentrada = textBox1.Text;
}


//Proceso
private void button1_Click(object sender, EventArgs e)
{
textosalida = textosinespacios(textoentrada);
textBox2.Text = textosalida.ToString();
}


Eliminar espacios en blanco




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero14
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

//Variables
string textoentrada, textosalida = "", t;
int i, p;


// Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
textoentrada = textBox1.Text;
}
//Proceso y salida
private void button1_Click(object sender, EventArgs e)
{
p = 0;
textoentrada = textoentrada.Trim();
for (i = 0; i < textoentrada.Length; i++)
{
if (textoentrada.Substring(i, 1).Equals(" "))
{
t = textoentrada.Substring(p, i - p);
p = i + 1;
textosalida = textosalida + t;
}
}
t = textoentrada.Substring(p, i - p);
textosalida = textosalida + t;


textBox2.Text = textosalida.ToString();
}


Sumar mediante una Función




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero13
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Variables
int n1, n2, s;
private void textBox1_TextChanged(object sender, EventArgs e)
{
n1 = int.Parse(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
n2 = int.Parse(textBox2.Text);
}

private void button1_Click(object sender, EventArgs e)
{
//Proceso
s = Sumar(n1, n2);
textBox3.Text = s.ToString();
}


Suma Matriz Bidimensional 3x2





using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace numero12
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

//Variables
int s = 0, i, j;

// Arreglos

int[,] n = new int[3, 2];

//Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
n[0, 0] = int.Parse(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
n[0, 1] = int.Parse(textBox2.Text);
}

private void textBox3_TextChanged(object sender, EventArgs e)
{
n[1, 0] = int.Parse(textBox3.Text);
}

private void textBox4_TextChanged(object sender, EventArgs e)
{
n[1, 1] = int.Parse(textBox4.Text);
}

private void textBox5_TextChanged(object sender, EventArgs e)
{
n[2, 0] = int.Parse(textBox5.Text);
}

private void textBox6_TextChanged(object sender, EventArgs e)
{
n[2, 1] = int.Parse(textBox6.Text);
}