Skip to content

Instantly share code, notes, and snippets.

@xreiju
Created February 25, 2017 11:53
Show Gist options
  • Save xreiju/0a8331599bc9cf1f1e79910b9b328a2c to your computer and use it in GitHub Desktop.
Save xreiju/0a8331599bc9cf1f1e79910b9b328a2c to your computer and use it in GitHub Desktop.
import std.stdio, std.format;
class KNH {
private bool _burn = false;
void burn() {
this._burn = true;
}
}
void main() {
int k = 10;
KNH[] knhList;
for(int i = 0; i < k; i++) knhList ~= new KNH;
foreach(v; knhList) {
v.burn();
}
writeln(format("%s KNH(s) burned", k));
}
//10 KNH(s) burned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment