Shadow Walker
易水侠客 · 共 7 篇文章
C语言中的graphics.h问题
如果头文件有这个,#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 C++…
2013-07-06 14:34 · C programming · 评论(0)
gas model
%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 line gnd(nx/4:nx/2-2,ny/2)=1…
2013-05-29 22:41 · cellular automata · 评论(0)
The game of life
%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;'); %define the stop button erasebutton…
2013-05-29 22:25 · cellular automata · 评论(0)
Matlab and nonlinear dynamic
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)*x(n)*(1-x(n)); plot(mu…
2013-05-29 22:02 · cellular automata · 评论(0)
C++ and Langton's ant
// 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=40; while(t<T){ if((mnew<mold)&&(nnew==nol…
2013-05-29 21:26 · cellular automata · 评论(0)
Java and Cellular Automata
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 { private int nRows,nC…
2013-05-29 21:04 · cellular automata · 评论(0)
html5
HTML5是用于取代1999年所制定的 HTML 4.01 和 XHTML 1.0 标准的 HTML 标准版本,现在仍处于发展阶段,但大部分浏览器已经支持某些 HTML5 技术。HTML 5有两大特点:首先,强化了 Web 网页的表现性能。其次,追加了本地数据库等 Web 应用的功能。广义论及HTML5时,实际指的是包括HTML、CSS和JavaScript在内的一套技术组合。它希望能够减少浏览器对于需要插件的丰富性网络应用服务(plug-in-based rich internet application,RIA),如Adobe Flash、Microsoft Silverlight,与O…
2013-05-23 17:57 · 评论(0)