Created
March 11, 2016 19:36
-
-
Save anonymous/669edd747565fee4d40e to your computer and use it in GitHub Desktop.
Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity/?gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract ForumSite{ | |
struct message{ | |
string title; | |
string content; | |
int replyTo; | |
uint8[3] replies; | |
} | |
mapping (uint=>message) chain; | |
uint pos; | |
function ForumSite(string title_, string message_){ | |
chain[0]=message(title_,message_,0,[0,0,0]); | |
} | |
function printMessage() constant returns (string){ | |
return chain[0].title;//+"\n------------------\n"+chain[0].content+"\n\nIn reply to "+chain[0].replyTo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment