文章列表
如果头文件有这个,#include <graphics.h>,编译时会显示 Cannot open include file: 'graphics.h': No such file or directory
VC 绘图库(下载graphics.h):可以在 VC 下像 Turbo C 的 BGI 一样简单的绘图
安装 下载的压缩包里除了说明,只有两个主要文件,将 graphics.lib 拷贝到 VC6 文件夹下的 Lib 文件夹内,将 graphics.h 拷贝到 Include 文件夹内,仅此而已,所以我就偷懒没有做安装程序了。 使用说明 目前只模拟了极少数 Borland ...
gas model
- 博客分类:
- cellular automata
%CA driver
%HPP-gas
clear all
clf
nx=52; %must be divisible by 4
ny=100;
z=zeros(nx,ny);
o=ones(nx,ny);
sand = z ;
sandNew = z;
gnd = z ;
diag1 = z;
diag2 = z;
and12 = z;
or12 = z;
sums = z;
orsum = z;
gnd(1:nx,ny-3)=1 ; % right ground line
gnd(1:nx,3)=1 ; % left ground lin ...
- 2013-05-29 22:41
- 浏览 613
- 评论(0)
%Conway's life with GUI
clf
clear all
%=============================================
%build the GUI
%define the plot button
plotbutton=uicontrol('style','pushbutton',...
'string','Run', ...
'fontsize',12, ...
'position',[100,400,50,20], ...
'callback', 'run=1;');
%defin ...
- 2013-05-29 22:25
- 浏览 587
- 评论(0)
clear all;
close all;
%mu=0.5;
mu=2.6:3e-4:4;
x=0.6*ones(1,200);
%for n=1:200
% x(n+1)=mu*x(n)*(1-x(n));
%end
%plot(x(1,:),'k','markersize',10);
%xlabel('n');
%ylabel('x(n)');
title('logistic(\mu=0.5)');
mu=2.6:3e-4:4;
k=length(mu);
x=linspace(0.6,0,k);
for n=1:k
x(n+1)=mu(n) ...
- 2013-05-29 22:02
- 浏览 568
- 评论(0)
// ant.cpp
#include <iostream>
using namespace std;
int main(void){
int N=5;
int **G= new int*[N];
for(int i=0;i<N;i++) G[i] = new int[N];
for(int j=0;j<N;j++){
for(int k=0;k<N;k++){
G[j][k]=1;
}
}
int mold=3;int nold=2;int mnew=2;int nnew=2;
int t=0;int T= ...
- 2013-05-29 21:26
- 浏览 607
- 评论(0)
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;
class JButtonGame extends JFrame implements ActionListener {
pri ...
- 2013-05-29 21:04
- 浏览 750
- 评论(0)