ID:141989
 
Code:
mob/verb
test()
new card_handle(src,src)
deck()
world<<src.hand




mob/var/hand[]=new

card_handle
New(mob/player1,mob/player2)
world<<"lawl"
var/list/deck=new
for(var/obj/card/c)
deck+=c
world<<"added [c]"
while(player1.hand<8)
var/p=pick(deck)
deck-=p
player1.hand+=p
world<<"player one has recieved: [p]"
while(player2.hand<8)
var/p=pick(deck)
deck-=p
player2.hand+=p
world<<"player one has recieved: [p]"
//Now that all is set up, both players have 8 cards, we can begin\
our crazy eights game! Time to start up the turns.

turn_start(player1,player2)

////////////////////////////////////////////////////
proc
turn_start(mob/player1,mob/player2)
cards_on_screen(player1)
cards_on_screen(player2)
///////////////////////////////////////////////////
cards_on_screen(mob/player)
var/cards=player.hand.len
for(var/obj/card/i in player.hand)
while(cards)
cards--
i.screen_loc="[cards],1"


Problem description:

I decided to make a crazy eights card game, I wanted to mess around with lists. However I am unsure of how to run a datum. Is calling New a good way of starting one up? I seem to get errors attempting this.

EDIT: I do know what a datum is.

(some of the coding is still not complete)

Create datums like you would any other atom.
new/card_handle(src,src) //create a card_handle datum with src being player1 and player2
//just like
new/obj/pickles(src) //create a pickle in your inventory
You can't "run a dantum". There is no such thing as a dantum, and a datum is able to be considered a thing. I personally consider them concepts of things, like a party, etc. You run a proc; New() is a good way to call one procedure, as is doing it manually if you have more than one thing to do.
In response to Kaiochao
I already tried executing it with new datum() but it failed. Something to do with a list. Unfortunately I'm not exactly sure why. It only runs the first test message after a mass of "red errors" in the game, indicating that something is wrong. Maybe I'm just doing something wring with me lists?
In response to Speedro
_>. It's called a type path. datum != a type path.

EDIT: /datum is the type path.

This_Is_A_Datum
New()
world << "You made a datum. I bet it took ages to figure this out, eh?"
mob/verb/Datum() new /This_Is_A_Datum()
In response to Jeff8500
I know that already. I knew all of that. >_>

I actually initially had it exactly like that. It's only not like that because it wasn't working.
In response to Speedro
That "red error" is called a "runtime" error.
You need to read these, and you can find what the problem is.

You are comparing a list to an integer. (player.hand<8)
I imagine this should return a runtime error for comparing a non-integer to an integer.
In response to Keeth
Ah, so I should be checking hand.len is greater than 8. Thanks.