Skip to content
This repository was archived by the owner on Aug 3, 2021. It is now read-only.

Fixed inconsistencies between instructions and answers. #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions src/course-codes/chapter1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ contract SocialMediaPayment (owner: ByStr20)`
const l3: ILessonCode = {
initialCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
(* Start typing from the line below. *)
`,
answerCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
(* Start typing from the line below. *)
field username : String = "Alice"`
};

const l4: ILessonCode = {
initialCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

(* Start typing from the line below *)
`,
answerCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

(* Start typing from the line below *)
Expand All @@ -54,15 +54,15 @@ end`
const l5: ILessonCode = {
initialCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

transition changeName()
(* Start typing from the line below *)
end`,
answerCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

transition changeName()
Expand All @@ -74,7 +74,7 @@ end`
const l6: ILessonCode = {
initialCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

transition changeName()
Expand All @@ -83,7 +83,7 @@ transition changeName()
end`,
answerCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

transition changeName()
Expand All @@ -96,34 +96,33 @@ end`
const l7: ILessonCode = {
initialCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"


(* Start typing in the parentheses below *)
transition changeName()
username := newname
transition changeName ()
username := newname
end
`,
answerCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"

(* Start typing in the parentheses below *)
transition changeName(newname: String)
transition changeName (newname : String)
username := newname
end`
};

const l8: ILessonCode = {
initialCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"
(*Declare the two new mutable variables below. You don’t need to use any semicolons to separate the lines outside the transitions*)

transition changeName(newname: String)
transition changeName(newname : String)
username := newname
(*Use ‘accept’ command in the line below which will accept the amount sent to this transition.*)

Expand All @@ -133,15 +132,16 @@ end
`,
answerCode: `scilla_version 0

contract SocialMediaPayment (owner: ByStr20)
contract SocialMediaPayment (owner : ByStr20)
field username : String = "Alice"
(*Declare the two new mutable variables below. You don’t need to use any semicolons to separate the lines outside the transitions*)
field user_address : ByStr20 = 0x1234567890123456789012345678901234567890
field user_tokens: Uint128 = Uint128 0
field user_tokens : Uint128 = Uint128 0

transition changeName(newname: String)
transition changeName(newname : String)
username := newname;
(*Use ‘accept’ command in the line below which will accept the amount sent to this transition.*)
accept;
accept;
(*Assign the value of the implicit variables to the new mutable variables in the lines below. You’ll need to use the semicolons to separate the lines in the transition*)
user_address := _sender;
user_tokens := _amount
Expand All @@ -151,24 +151,24 @@ end`

const l9: ILessonCode = {
initialCode: `contract Zealgame
(owner: ByStr20)
(owner : ByStr20)
field player_name : String = "Alice"
field player_address : ByStr20 = 0x1234567890123456789012345678901234567890
field player_zeal: Uint128 = Uint128 0

Transition changeName(newname: String)
Transition changeName(newname : String)
player_name := newname;
player_address := _sender;
player_zeal := _amount
end
`,
answerCode: `contract Zealgame
(owner: ByStr20)
(owner : ByStr20)
field player_name : String = "Alice"
field player_address : ByStr20 = 0x1234567890123456789012345678901234567890
field player_zeal: Uint128 = Uint128 0

Transition changeName(newname: String)
Transition changeName(newname : String)
player_name := newname;
player_address := _sender;
player_zeal := _amount
Expand Down
Loading