WOW! so much has happened! The pitch block sounds amazing, thank you Jens, you're a magician!
bharvey, I'm not sure I agree with your comment to my "mockery of the forum system"... basically, I wanted to express why I thought people shouldn't use the blocks just to boost views, but failing to find a proper reason, I made one up
I don't mind it being stickied, I think that would be a great honour, and it has never left the front page since it was created several months ago, but equally I don't mind if it isn't stickied.
Offline
It only left the front page once actually
Offline
Oh and how big is blockshop now
Offline
I love Panther!
Offline
johnnydean1 wrote:
paulpsicle wrote:
johnnydean1 wrote:
I just made a <File $String$ exists?> block
I made a simpler one:
Code:
| t2 t3 | t2 _ self numFileLines: (t1). t3 _ t2 asString. (t3 = '') ifTrue:[^ false]. ^trueWhat if the file was empty...
then numFileLines: returns 0 not blank.
Offline
climber59 wrote:
I want the make file blocks.
Name:
make file $String$
Type:
r
Code:
| f contents exists other writing temp var dest|
(self askForFileIO = true)
ifFalse:
[
^ self
].
f_ t1.
dest_ t1.
writing_ 'I exist'.
contents_ self readFile: (dest).
self writeText: (writing) toFile: (dest).
other_ self readFile: (dest).
temp_ self stringLength: (writing).
var_ self stringLength: (other).
temp_ var - temp.
temp_ temp + 1.
temp_ self letters: (temp) through: (var) of: (other).
temp = writing
ifTrue: [
exists_ true.
self clearFile: (dest).
contents = ''
ifFalse: [
self writeText: (contents) toFile: (dest).
].
]
ifFalse: [
exists_ false.
].
exists = false
ifTrue: [
FileStream newFileNamed: f .
].
----------------------
If you want to change where its saved put the file directory before it so:
MyDocuments\hi.txt
is a non-working example
Offline
sparks wrote:
blockshop has about 30 shared blocks right now.
Only 30? I thought it would have more...
Offline
sparks wrote:
hi Mp. Yeah, it's still working better than I thought even though it kinda broke... I guess people will share more once it's released.
Has nXIII really shared 31 blocks?
Offline
markyparky56 wrote:
sparks wrote:
hi Mp. Yeah, it's still working better than I thought even though it kinda broke... I guess people will share more once it's released.
Has nXIII really shared 31 blocks?
haha! NO! he's done about 4 or 5? we have a submission section for people to send us blocks on the site, remember
Offline
sparks wrote:
markyparky56 wrote:
sparks wrote:
hi Mp. Yeah, it's still working better than I thought even though it kinda broke... I guess people will share more once it's released.
Has nXIII really shared 31 blocks?
haha! NO! he's done about 4 or 5? we have a submission section for people to send us blocks on the site, remember
Thats what the project says anyway.
Offline
Hey, sparks! Don't you think we need to add a 'write file ___ to ___' block to 1.1?
Offline
Doing stuff. Not panther.
No, I meant something like:
create file ___ in folder ___
Offline
SeptimusHeap wrote:
Doing stuff. Not panther.
No, I meant something like:
create file ___ in folder ___
I've got a custom block (Made by jd1) that does that.
Offline
I did it by coping the code, then opening a workspace. Then select all then select file in. Allthough you need to save a copy of your blockspecs as it alters them.
Offline
can someone tell me what's wrong with this script? (I made it in CYOB and it's supposed to convert 24 bit binary numbers to hexadecimal values.)
| n1 n2 n3 n4 n5 n6 num hex | n1 _ self letters: 21 through: 24 of: t1. n2 _ self letters: 17 through: 20 of: t1. n3 _ self letters: 13 through: 16 of: t1. n4 _ self letters: 9 through: 12 of: t1. n5 _ self letters: 5 through: 8 of: t1. n6 _ self letters: 1 through: 4 of: t1. num _ self concatenate num with: self letter: 4 of n1 + self letter: 3 of: n1 * 2 + self letter: 2 of: n1 * 4 + self letter: 1 of: n1 * 8. num _ self concatenate: num with: self letter: 4 of n2 + self letter: 3 of: n2 * 2 + self letter: 2 of: n2 * 4 + self letter: 1 of: n2 * 8. num _ self concatenate: num with: self letter: 4 of n3 + self letter: 3 of: n3 * 2 + self letter: 2 of: n3 * 4 + self letter: 1 of: n3 * 8. num _ self concatenate: num with: self letter: 4 of n4 + self letter: 3 of: n4 * 2 + self letter: 2 of: n4 * 4 + self letter: 1 of: n4 * 8. num _ self concatenate: num with: self letter: 4 of n5 + self letter: 3 of: n5 * 2 + self letter: 2 of: n5 * 4 + self letter: 1 of: n5 * 8. num _ self concatenate: num with: self letter: 4 of n6 + self letter: 3 of: n6 * 2 + self letter: 2 of: n6 * 4 + self letter: 1 of: n6 * 8. ^ num
EDIT: That's not the whole thing, I've only got the first part of it done and it gives me an error.
Last edited by ScratchReallyROCKS (2010-07-07 22:53:12)
Offline
| n1 n2 n3 n4 n5 n6 num hex x1 m1 c1 h1| n1_ self letters: (1) through: (6) of: (t1). n1_ n1 asString. x1_ self letter: (4) of: (n1). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n1). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n1). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n1). h1_ h1 asNumber. h1_ h1 * 8. n1_ x1 + c1. n1_ n1 + m1. n1_ n1 + h1. ^ n1
This works. So just do that with them all
Last edited by johnnydean1 (2010-07-08 03:36:53)
Offline
johnnydean1 wrote:
I did it by coping the code, then opening a workspace. Then select all then select file in. Allthough you need to save a copy of your blockspecs as it alters them.
when I did this, is broke all the blocks and the control blocks all vanished. there weren't any pitch blocks either...
Offline
You can edit the changeset either in a workspace or in a browser (open a FileList select the .cs file right blick and select "browse"). Then you can just copy the one line with the spec for the pitch block to another workspace or to the clipboard and delete the #blockSpecs method from the changeset. That way filing in the - modified - changeset will not overwrite your existing specs. Afterwards edit Panther's block specs and paste the pitch block's spec into it.
If that doesn't work, holler and I'll be glad to help
Last edited by Jens (2010-07-08 10:33:00)
Offline
ScratchReallyROCKS wrote:
can someone tell me what's wrong with this script? (I made it in CYOB and it's supposed to convert 24 bit binary numbers to hexadecimal values.)
Code:
| n1 n2 n3 n4 n5 n6 num hex | n1 _ self letters: 21 through: 24 of: t1. n2 _ self letters: 17 through: 20 of: t1. n3 _ self letters: 13 through: 16 of: t1. n4 _ self letters: 9 through: 12 of: t1. n5 _ self letters: 5 through: 8 of: t1. n6 _ self letters: 1 through: 4 of: t1. num _ self concatenate num with: self letter: 4 of n1 + self letter: 3 of: n1 * 2 + self letter: 2 of: n1 * 4 + self letter: 1 of: n1 * 8. num _ self concatenate: num with: self letter: 4 of n2 + self letter: 3 of: n2 * 2 + self letter: 2 of: n2 * 4 + self letter: 1 of: n2 * 8. num _ self concatenate: num with: self letter: 4 of n3 + self letter: 3 of: n3 * 2 + self letter: 2 of: n3 * 4 + self letter: 1 of: n3 * 8. num _ self concatenate: num with: self letter: 4 of n4 + self letter: 3 of: n4 * 2 + self letter: 2 of: n4 * 4 + self letter: 1 of: n4 * 8. num _ self concatenate: num with: self letter: 4 of n5 + self letter: 3 of: n5 * 2 + self letter: 2 of: n5 * 4 + self letter: 1 of: n5 * 8. num _ self concatenate: num with: self letter: 4 of n6 + self letter: 3 of: n6 * 2 + self letter: 2 of: n6 * 4 + self letter: 1 of: n6 * 8. ^ numEDIT: That's not the whole thing, I've only got the first part of it done and it gives me an error.
I remade all of that and it works:
|length n1 n2 n3 n4 n5 n6 num hex x1 m1 c1 h1| n1_ 0000. n2_ 0000. n3_ 0000. n4_ 0000. n5_ 0000. n6_ 0000. length_ self stringLength: (t1). length > 23 ifTrue: [ n1_ self letters: (21) through: (24) of: (t1). n1_ n1 asString. ]. length > 19 ifTrue: [ n2_ self letters: (17) through: (20) of: (t1). n2_ n2 asString. ]. length > 15 ifTrue: [ n3_ self letters: (13) through: (16) of: (t1). n3_ n3 asString. ]. length > 11 ifTrue: [ n4_ self letters: (9) through: (12) of: (t1). n4_ n4 asString. ]. length > 7 ifTrue: [ n5_ self letters: (5) through: (8) of: (t1). n5_ n5 asString. ]. length > 3 ifTrue: [ n6_ self letters: (1) through: (4) of: (t1). n6_ n6 asString. ]. x1_ self letter: (4) of: (n1). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n1). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n1). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n1). h1_ h1 asNumber. h1_ h1 * 8. n1_ x1 + c1. n1_ n1 + m1. n1_ n1 + h1. x1_ self letter: (4) of: (n2). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n2). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n2). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n2). h1_ h1 asNumber. h1_ h1 * 8. n2_ x1 + c1. n2_ n2 + m1. n2_ n2 + h1. x1_ self letter: (4) of: (n3). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n3). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n3). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n3). h1_ h1 asNumber. h1_ h1 * 8. n3_ x1 + c1. n3_ n3 + m1. n3_ n3 + h1. x1_ self letter: (4) of: (n4). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n4). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n4). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n4). h1_ h1 asNumber. h1_ h1 * 8. n4_ x1 + c1. n4_ n4 + m1. n4_ n4 + h1. x1_ self letter: (4) of: (n5). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n5). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n5). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n5). h1_ h1 asNumber. h1_ h1 * 8. n5_ x1 + c1. n5_ n5 + m1. n5_ n5 + h1. x1_ self letter: (4) of: (n6). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n6). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n6). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n6). h1_ h1 asNumber. h1_ h1 * 8. n6_ x1 + c1. n6_ n6 + m1. n6_ n6 + h1. num_ ''. num_ self concatenate: (num) with: (n1). num_ self concatenate: (num) with: (n2). num_ self concatenate: (num) with: (n3). num_ self concatenate: (num) with: (n4). num_ self concatenate: (num) with: (n5). num_ self concatenate: (num) with: (n6). ^ num
You owe me big time this took me about 1 hour!
Offline
johnnydean1 wrote:
I remade all of that and it works:
Code:
|length n1 n2 n3 n4 n5 n6 num hex x1 m1 c1 h1| n1_ 0000. n2_ 0000. n3_ 0000. n4_ 0000. n5_ 0000. n6_ 0000. length_ self stringLength: (t1). length > 23 ifTrue: [ n1_ self letters: (21) through: (24) of: (t1). n1_ n1 asString. ]. length > 19 ifTrue: [ n2_ self letters: (17) through: (20) of: (t1). n2_ n2 asString. ]. length > 15 ifTrue: [ n3_ self letters: (13) through: (16) of: (t1). n3_ n3 asString. ]. length > 11 ifTrue: [ n4_ self letters: (9) through: (12) of: (t1). n4_ n4 asString. ]. length > 7 ifTrue: [ n5_ self letters: (5) through: (8) of: (t1). n5_ n5 asString. ]. length > 3 ifTrue: [ n6_ self letters: (1) through: (4) of: (t1). n6_ n6 asString. ]. x1_ self letter: (4) of: (n1). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n1). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n1). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n1). h1_ h1 asNumber. h1_ h1 * 8. n1_ x1 + c1. n1_ n1 + m1. n1_ n1 + h1. x1_ self letter: (4) of: (n2). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n2). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n2). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n2). h1_ h1 asNumber. h1_ h1 * 8. n2_ x1 + c1. n2_ n2 + m1. n2_ n2 + h1. x1_ self letter: (4) of: (n3). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n3). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n3). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n3). h1_ h1 asNumber. h1_ h1 * 8. n3_ x1 + c1. n3_ n3 + m1. n3_ n3 + h1. x1_ self letter: (4) of: (n4). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n4). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n4). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n4). h1_ h1 asNumber. h1_ h1 * 8. n4_ x1 + c1. n4_ n4 + m1. n4_ n4 + h1. x1_ self letter: (4) of: (n5). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n5). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n5). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n5). h1_ h1 asNumber. h1_ h1 * 8. n5_ x1 + c1. n5_ n5 + m1. n5_ n5 + h1. x1_ self letter: (4) of: (n6). x1_ x1 asNumber. x1_ x1 * 1. c1_ self letter: (3) of: (n6). c1_ c1 asNumber. c1_ c1 * 2. m1_ self letter: (2) of: (n6). m1_ m1 asNumber. m1_ m1 * 4. h1_ self letter: (1) of: (n6). h1_ h1 asNumber. h1_ h1 * 8. n6_ x1 + c1. n6_ n6 + m1. n6_ n6 + h1. num_ ''. num_ self concatenate: (num) with: (n1). num_ self concatenate: (num) with: (n2). num_ self concatenate: (num) with: (n3). num_ self concatenate: (num) with: (n4). num_ self concatenate: (num) with: (n5). num_ self concatenate: (num) with: (n6). ^ numYou owe me big time this took me about 1 hour!
It may have taken you an hour, but it's still not what I want. I need a code that converts a a 24 bit binary number into a hexadecimal value. Use this to see how binary and hexadecimal numbers line up:
Binary | Hexadecimal
0000 | 0
0001 | 1
0010 | 2
0011 | 3
0100 | 4
0101 | 5
0110 | 6
0111 | 7
1000 | 8
1001 | 9
1010 | A
1011 | B
1100 | C
1101 | D
1110 | E
1111 | F
so that means that hexadecimal FFFFFF or white, would be 111111111111111111111111 in binary, and hexadecimal 0000FF or blue, would be 000000000000000011111111 in binary.
Offline