Re: [fpc-pascal] C# translatation

2017-01-08 Thread Sven Barth
On 08.01.2017 18:36, Bernd Oppolzer wrote: > Am 08.01.2017 um 18:22 schrieb Sven Barth: >> >> Am 08.01.2017 17:32 schrieb "Bernd Oppolzer" >> mailto:bernd.oppol...@t-online.de>>: >> > >> > Am 08.01.2017 um 11:46 schrieb Sven Barth: >> >> >> >> On 08.01.2017 10:55, Ryan Joseph wrote: >> >>> >> >>> I

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Bernd Oppolzer
Am 08.01.2017 um 18:22 schrieb Sven Barth: Am 08.01.2017 17:32 schrieb "Bernd Oppolzer" mailto:bernd.oppol...@t-online.de>>: > > Am 08.01.2017 um 11:46 schrieb Sven Barth: >> >> On 08.01.2017 10:55, Ryan Joseph wrote: >>> >>> I’m going to attempt to translate a perlin noise function (from htt

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Dmitry Boyarintsev
On Sun, Jan 8, 2017 at 12:22 PM, Sven Barth wrote: > The closest equivalence to bitwise and in Pascal is bitwise and. > > The operators "and", "or", "xor" and "not" are logical or bitwise > depending on their arguments. > With that said... On Sun, Jan 8, 2017 at 11:46 AM, José Mejuto wrote:

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Sven Barth
Am 08.01.2017 17:32 schrieb "Bernd Oppolzer" : > > Am 08.01.2017 um 11:46 schrieb Sven Barth: >> >> On 08.01.2017 10:55, Ryan Joseph wrote: >>> >>> I’m going to attempt to translate a perlin noise function (from https://gist.github.com/Flafla2/f0260a861be0ebdeef76) but there are a few things that s

Re: [fpc-pascal] C# translatation

2017-01-08 Thread José Mejuto
El 08/01/2017 a las 17:31, Bernd Oppolzer escribió: Please keep in mind that & is a bitwise and in C whereas && is a logical and; this makes much difference and has to be implemented or converted differently with Pascal, IMO. the closest equivalence to bitwise and in Pascal are set intersections

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Bernd Oppolzer
Am 08.01.2017 um 11:46 schrieb Sven Barth: On 08.01.2017 10:55, Ryan Joseph wrote: I’m going to attempt to translate a perlin noise function (from https://gist.github.com/Flafla2/f0260a861be0ebdeef76) but there are a few things that stopped me from starting. 1) What is & doing in this assignm

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Sven Barth
On 08.01.2017 14:05, Ryan Joseph wrote: > >> On Jan 8, 2017, at 7:54 PM, Sven Barth wrote: >> >> Ehm, right. Add the Math unit, it contains an operator overload for >> floating points. Alternatively you can use (also from the Math unit) the >> FMod() function. > > Hmmm, adding Math didn’t help a

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Ryan Joseph
> On Jan 8, 2017, at 7:54 PM, Sven Barth wrote: > > Ehm, right. Add the Math unit, it contains an operator overload for > floating points. Alternatively you can use (also from the Math unit) the > FMod() function. Hmmm, adding Math didn’t help and the FMod function is not found even. http://ww

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Sven Barth
On 08.01.2017 13:01, Ryan Joseph wrote: > >> On Jan 8, 2017, at 6:55 PM, Ryan Joseph wrote: >> >> why am I getting this error? Operator is not overloaded: "Double" mod >> “LongInt”. Mod can’t be used with double and integers like in C? > > > Sorry for the repeat. Same error here but "Operator

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Sven Barth
On 08.01.2017 12:55, Ryan Joseph wrote: > >> On Jan 8, 2017, at 5:46 PM, Sven Barth wrote: >> >>> 2) % is the mod operator in pascal right? So what is the modular assignment >>> %=? num = num mod repeat? >>> >>> p[x] = permutation[x%256]; >>> >>> if (repeat > 0) num %= repeat; >> >> Correct for

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Ryan Joseph
> On Jan 8, 2017, at 6:55 PM, Ryan Joseph wrote: > > why am I getting this error? Operator is not overloaded: "Double" mod > “LongInt”. Mod can’t be used with double and integers like in C? Sorry for the repeat. Same error here but "Operator is not overloaded: "Double" and “Byte””. This work

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Ryan Joseph
> On Jan 8, 2017, at 5:46 PM, Sven Barth wrote: > >> 2) % is the mod operator in pascal right? So what is the modular assignment >> %=? num = num mod repeat? >> >> p[x] = permutation[x%256]; >> >> if (repeat > 0) num %= repeat; > > Correct for both. why am I getting this error? Operator is

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Ryan Joseph
> On Jan 8, 2017, at 5:46 PM, Sven Barth wrote: > > if h and 1 = 0 then > result := u > else > result := -u; > if h and 2 = 0 then > result := result + v > else > result := result - v; Thanks Sven, I appreciate it. I forgot about binary and operator some how also... C# is pretty nice lang

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Sven Barth
On 08.01.2017 10:55, Ryan Joseph wrote: > I’m going to attempt to translate a perlin noise function (from > https://gist.github.com/Flafla2/f0260a861be0ebdeef76) but there are a few > things that stopped me from starting. > > 1) What is & doing in this assignment? I see this many places in assig

[fpc-pascal] C# translatation

2017-01-08 Thread Ryan Joseph
I’m going to attempt to translate a perlin noise function (from https://gist.github.com/Flafla2/f0260a861be0ebdeef76) but there are a few things that stopped me from starting. 1) What is & doing in this assignment? I see this many places in assignments. int h = hash & 15; 2) % is the mod opera